diff --git a/GeoffreyApp/api/commands.py b/GeoffreyApp/api/commands.py index eb29239..f4552c5 100644 --- a/GeoffreyApp/api/commands.py +++ b/GeoffreyApp/api/commands.py @@ -517,11 +517,11 @@ def info(location_name): if type(loc) == Shop: loc_json["items"] = [] - for item in loc.shop_selling.all(): + for item in loc.shop_selling.order_by("item_name").all(): loc_json["items"].append(item.json) elif type(loc) == PublicFarm: loc_json["resources"] = [] - for resource in loc.resource.all(): + for resource in loc.resource.order_by("resource_name").all(): loc_json["resources"].append(resource.json) return loc_json diff --git a/GeoffreyApp/models.py b/GeoffreyApp/models.py index 8fd3490..f046d81 100644 --- a/GeoffreyApp/models.py +++ b/GeoffreyApp/models.py @@ -113,7 +113,7 @@ class Player(models.Model): return {"name": self.name, "mc_uuid": self.mc_uuid, "discord_uuid": self.discord_uuid, - "primary_location": self.primary_location.json + "primary_location": self.primary_location.id } @property @@ -226,7 +226,6 @@ class Location(models.Model): "location": self.position, "tunnel": None if self.tunnel is None else self.tunnel.tunnel_str, "link": self.link, - "primary_location": self.player.primary_location } @property