Merge pull request 'Sort item names in `info` alphabetically' (#28) from issue/info_item_sort into main
Reviewed-on: https://git.etztech.xyz/ZeroHD/Geoffrey/pulls/28doc_update
commit
a7b2413136
|
@ -517,11 +517,11 @@ def info(location_name):
|
||||||
|
|
||||||
if type(loc) == Shop:
|
if type(loc) == Shop:
|
||||||
loc_json["items"] = []
|
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)
|
loc_json["items"].append(item.json)
|
||||||
elif type(loc) == PublicFarm:
|
elif type(loc) == PublicFarm:
|
||||||
loc_json["resources"] = []
|
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)
|
loc_json["resources"].append(resource.json)
|
||||||
|
|
||||||
return loc_json
|
return loc_json
|
||||||
|
|
|
@ -113,7 +113,7 @@ class Player(models.Model):
|
||||||
return {"name": self.name,
|
return {"name": self.name,
|
||||||
"mc_uuid": self.mc_uuid,
|
"mc_uuid": self.mc_uuid,
|
||||||
"discord_uuid": self.discord_uuid,
|
"discord_uuid": self.discord_uuid,
|
||||||
"primary_location": self.primary_location.json
|
"primary_location": self.primary_location.id
|
||||||
}
|
}
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -226,7 +226,6 @@ class Location(models.Model):
|
||||||
"location": self.position,
|
"location": self.position,
|
||||||
"tunnel": None if self.tunnel is None else self.tunnel.tunnel_str,
|
"tunnel": None if self.tunnel is None else self.tunnel.tunnel_str,
|
||||||
"link": self.link,
|
"link": self.link,
|
||||||
"primary_location": self.player.primary_location
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
Loading…
Reference in New Issue