Models¶
Models used in Geoffrey
- class GeoffreyApp.models.APIToken(id, key, name, commands_perm, mod_commands_perm, admin_commands_perm, model_api_perm)¶
- exception DoesNotExist¶
- exception MultipleObjectsReturned¶
- admin_commands_perm¶
Permission to use admin commands
- commands_perm¶
Permission to use the command api
- key¶
Key used to access the Geoffrey API
- mod_commands_perm¶
Permission to use mod commands
- model_api_perm¶
Permission to access the model api
- name¶
Name of the key
- class GeoffreyApp.models.Player(*args, **kwargs)¶
Model of a Player
- exception DoesNotExist¶
- exception MultipleObjectsReturned¶
- discord_uuid¶
Discord UUID
- property json¶
JSON representation of the Player
{ "name" : "self.name", "mc_uuid": "self.mc_uuid", "discord_uuid": "self.discord_uuid", "primary_location": "self.primary_location" }
- property link¶
href to the player page
- property loc_count¶
Number of locations the player is an owner of
- mc_uuid¶
Minecraft UUID
- name¶
In Game Username
- primary_location¶
User’s primary location
- class GeoffreyApp.models.Location(*args, **kwargs)¶
Model of a Location
- DIMENSIONS = (('O', 'Overworld'), ('N', 'Nether'), ('E', 'The End'))¶
Possible dimensions for a location to be in
- exception DoesNotExist¶
- exception MultipleObjectsReturned¶
- dimension¶
Dimension of Location
- property dynmap_url¶
Link to the location on the dynmap, none if there is no dynmap
- property get_owners¶
List of all the owners of the location
- info_page = None¶
Name of the info page view
- property json¶
JSON representation of the location
{ "type": "Base", "name": "Location", "x_coord": 0, "z_coord": 0, "dimension": "O", "owner": [], "tunnel": {}, "link": "/GeoffreyApp/Base/1" }
- property link¶
href to the location page
- property loc_child_obj¶
Child object
- property loc_type¶
The name of the location type
- name¶
Name of the location
- owner¶
Owner of Location
- property position¶
Formatted position of the location
- property tunnel¶
The tunnel associated if this location, None if no tunnel exists
- x_coord¶
X Position
- z_coord¶
Z Position
- class GeoffreyApp.models.Shop(id, name, x_coord, z_coord, dimension, location_ptr)¶
- exception DoesNotExist¶
- exception MultipleObjectsReturned¶
- class GeoffreyApp.models.Base(id, name, x_coord, z_coord, dimension, location_ptr)¶
- exception DoesNotExist¶
- exception MultipleObjectsReturned¶
- class GeoffreyApp.models.ItemListing(id, item_name, price, amount, date_restocked, shop)¶
- exception DoesNotExist¶
- exception MultipleObjectsReturned¶
- amount¶
Number of items
- date_restocked¶
Datetime the item was last restocked
- item_name¶
Name of the item
- property json¶
JSON representation of the item
{ "item_name": "dirt", "price": 1, "amount": 1, "date_restocked": 1553264508, "days_since_restock": 10, "normalized_price": 1, "shop": {} }
- property normalized_price¶
normalized price, price/amount
- property number_of_days_since_restocked¶
days since this item was restocked
- price¶
Number of diamonds per amount of items
- shop¶
Shop the item is sold at
- class GeoffreyApp.models.Tunnel(id, tunnel_number, tunnel_direction, location)¶
- exception DoesNotExist¶
- exception MultipleObjectsReturned¶
- TUNNEL_NAMES = (('N', ''), ('E', ''), ('S', ''), ('W', ''))¶
Tunnel Direction
- property json¶
JSON representation of the tunnel`
{ "location_name": "Base", "tunnel_direction": "N", "tunnel_number": 500 }
- location¶
Location that the tunnel is connected to
- tunnel_direction¶
Tunnel Direction
- tunnel_number¶
Tunnel coordinate
- property tunnel_str¶
formatted tunnel string
- class GeoffreyApp.models.PublicFarm(id, name, x_coord, z_coord, dimension, location_ptr)¶
- exception DoesNotExist¶
- exception MultipleObjectsReturned¶
- class GeoffreyApp.models.Resource(id, farm, resource_name)¶
- exception DoesNotExist¶
- exception MultipleObjectsReturned¶
- property json¶
JSON representation of the Resource
{ "name": "Dirt" "farm_id": 1 }
- class GeoffreyApp.models.PointOfInterest(id, name, x_coord, z_coord, dimension, location_ptr)¶
- exception DoesNotExist¶
- exception MultipleObjectsReturned¶
- class GeoffreyApp.models.Market(id, name, x_coord, z_coord, dimension, location_ptr)¶
- exception DoesNotExist¶
- exception MultipleObjectsReturned¶
- property json¶
JSON representation of the market
{ "type": "Market", "name": "Location", "x_coord": 0, "z_coord": 0, "dimension": "O", "owner": [], "tunnel": {}, "link": "/GeoffreyApp/Market/1", "shops": [] }
- class GeoffreyApp.models.Town(id, name, x_coord, z_coord, dimension, location_ptr)¶
- exception DoesNotExist¶
- exception MultipleObjectsReturned¶
- property get_residents¶
List of residents in the town in JSON farm
- property json¶
JSON representation of the town
{ "type": "Town", "name": "Location", "x_coord": 0, "z_coord": 0, "dimension": "O", "owner": [], "tunnel": {}, "link": "/GeoffreyApp/Town/1", "residents": [] }
- residents¶
Players who are members of the town