Apps¶
This document focuses on a detailed description of each app’s models and views. This should be enough to acquaint you with the basic workings of element43.
Large parts of this document are automatically generated and there are known problems with autogenerating docs for our views. Please consult the docstrings in the code if some piece of documentation is missing here.
api¶
Models¶
- class apps.api.models.APIKey(*args, **kwargs)¶
Holds API information for a user. One to many with user table.
Parameters: - id (AutoField) – Id
- keyid (PositiveIntegerField) – keyID for this character
- vcode (TextField) – vCode for this key
- expires (DateTimeField) – Expiry date for the key
- accessmask (BigIntegerField) – Access mask for this key
- is_valid (BooleanField) – Is this key valid?
- is_character_key (BooleanField) – Is this a character key? false = corporation key
- user_id (ForeignKey) – Fkey relationship to user table
- class apps.api.models.APITimer(*args, **kwargs)¶
Tracking API timers
Parameters: - id (AutoField) – Id
- character_id (ForeignKey) – FKey relationship to character table
- corporation_id (ForeignKey) – FKey relationship to corporation table
- apisheet (TextField) – Filename of API Call sheet
- nextupdate (DateTimeField) – Date/Time of next allowed API refresh
- class apps.api.models.CharSkill(*args, **kwargs)¶
Tracking skills
Parameters: - id (AutoField) – Id
- character_id (ForeignKey) – FKey relationship to character table
- skill_id (ForeignKey) – FK relationship to skill table
- skillpoints (PositiveIntegerField) – SP trained
- level (PositiveIntegerField) – level trained
- class apps.api.models.Character(*args, **kwargs)¶
Holds information specific to a character. This is a one-to-many relationship between users & characters (ie, a user can have multiple characters, but a character can only have one user). This stores API key information and other useful character-specific info.
Parameters: - id (BigIntegerField) – Unique key for this character, uses CCP character ID
- user_id (ForeignKey) – FKey relationship to user table
- apikey_id (ForeignKey) – FKey relationship to api key table
- name (TextField) – Name of character
- dob (DateTimeField) – DoB of character
- race (TextField) – Race of character
- bloodline (TextField) – Bloodline of character
- ancestry (TextField) – Ancestry of character
- gender (TextField) – Gender
- corp_name (TextField) – Name of corporation character is member of
- corp_id (BigIntegerField) – id of corporation
- alliance_name (TextField) – Name of alliance
- alliance_id (BigIntegerField) – id of alliance
- clone_name (TextField) – clone level name
- clone_skill_points (PositiveIntegerField) – max SP of clone
- balance (BigIntegerField) – isk on hand
- implant_memory_name (TextField) – name of memory implant
- implant_memory_bonus (PositiveIntegerField) – memory bonus
- implant_intelligence_name (TextField) – name of intelligence implant
- implant_intelligence_bonus (PositiveIntegerField) – intelligence bonus
- implant_charisma_name (TextField) – name of charisma implant
- implant_charisma_bonus (PositiveIntegerField) – charisma bonus
- implant_willpower_name (TextField) – name of willpower implant
- implant_willpower_bonus (PositiveIntegerField) – willpower bonus
- implant_perception_name (TextField) – name of perception implant
- implant_perception_bonus (PositiveIntegerField) – perception bonus
- cached_until (DateTimeField) – data cached until
- class apps.api.models.Corp(*args, **kwargs)¶
Table for CorporationSheet information
Parameters: - id (AutoField) – Id
- corp_id (BigIntegerField) – Corporation ID
- name (TextField) – Corporation name
- ticker (TextField) – Corp ticker
- ceo_id (BigIntegerField) – character ID of CEO
- ceo_name (TextField) – CEO Name
- stastation_id (ForeignKey) – Station corp headquarters is in
- description (TextField) – Description of corp if provided
- url (TextField) – URL for corporation
- tax_rate (PositiveIntegerField) – Tax rate of corporation
- member_count (PositiveIntegerField) – Number of members of corp
- member_limit (PositiveIntegerField) – Max number of members corp can support
- shares (PositiveIntegerField) – Number of shares of corp outstanding
- class apps.api.models.CorpDivision(*args, **kwargs)¶
Divisions in a corp
Parameters: - id (AutoField) – Id
- corporation_id (ForeignKey) – FK to corporation table
- account_key (PositiveIntegerField) – account key of corporation division
- description (TextField) – Name of division
- class apps.api.models.CorpPermissions(*args, **kwargs)¶
Permissions for corporations so multiple people can see corporation data
Parameters: - id (AutoField) – Id
- user_id (ForeignKey) – FKey relationship to user table
- corporation_id (ForeignKey) – FK to corporation table
- character_id (ForeignKey) – FKey relationship to character table
- view_wallet (BooleanField) – can view corporate wallet
- view_transaction (BooleanField) – can view corporate transactions
- view_research (BooleanField) – can view corporate research
- modify_rights (BooleanField) – can modify corprate rights
- class apps.api.models.CorpWalletDivision(*args, **kwargs)¶
Divisions in a corp
Parameters: - id (AutoField) – Id
- corporation_id (ForeignKey) – FK to corporation table
- account_key (PositiveIntegerField) – account key of corporation wallet account division
- description (TextField) – Name of wallet account division
- class apps.api.models.JournalEntry(*args, **kwargs)¶
Stores char/corp journal entries.
Parameters: - id (AutoField) – Id
- ref_id (BigIntegerField) – Unique refID from CCP for this journal entry. Not primary key - multiple characters could have access to a single corporation’s wallet API.
- character_id (ForeignKey) – FK relationship to character table
- corporation_id (ForeignKey) – FK relationship to corporation table
- date (DateTimeField) – Date and time of the transaction.
- ref_type_id (ForeignKey) – Transaction type FKey relationship.
- amount (FloatField) – Amount transferred between parties.
- balance (FloatField) – Balance in this wallet after this transaction.
- owner_name_1 (TextField) – Name of first party in the transaction.
- owner_id_1 (BigIntegerField) – Character or corporation ID of the first party.
- owner_name_2 (TextField) – Name of second party in the transaction.
- owner_id_2 (BigIntegerField) – Character or corporation ID of the second party.
- arg_name_1 (TextField) – Has different meanings - see: http://wiki.eve-id.net/APIv2_Char_JournalEntries_XML#Arguments
- arg_id_1 (PositiveIntegerField) – Has different meanings - see: http://wiki.eve-id.net/APIv2_Char_JournalEntries_XML#Arguments
- reason (TextField) – Has different meanings - see: http://wiki.eve-id.net/APIv2_Char_JournalEntries_XML#Arguments
- tax_receiver_id (BigIntegerField) – CorpID who received tax for this transaction.
- tax_amount (FloatField) – Amount of tax for this transaction.
- class apps.api.models.MarketOrder(*args, **kwargs)¶
This is the market order table off the CCP API
Parameters: - id_id (ForeignKey) – Unique key for this order, uses CCP order ID
- character_id (ForeignKey) – FK relationship to character table
- corporation_id (ForeignKey) – FK relationship to corporation table
- order_state (PositiveIntegerField) – Valid states: 0 = open/active, 1 = closed, 2 = expired (or fulfilled), 3 = cancelled, 4 = pending, 5 = character deleted
- account_key (PositiveIntegerField) – Which division this order is using as its account. Always 1000 for characters, but in the range 1000 to 1006 for corporations.
- escrow (FloatField) – Escrow amount for this order
- class apps.api.models.MarketTransaction(*args, **kwargs)¶
Stores char/corp market transactions.
Parameters: - id (AutoField) – Id
- character_id (ForeignKey) – FK relationship to character table
- corporation_id (ForeignKey) – FK relationship to corporation table
- date (DateTimeField) – Date and time of the transaction.
- transaction_id (BigIntegerField) – Non-unique transaction ID.
- invtype_id (ForeignKey) – The item traded in this transaction.
- quantity (IntegerField) – Number of items bought/sold.
- price (FloatField) – Price per unit of the item.
- client_id (BigIntegerField) – Character or corporation ID of the other party.
- client_name (TextField) – Name of other party.
- station_id (ForeignKey) – Station the transaction took place at.
- is_bid (BooleanField) – Marks whether this item was bought or sold.
- is_corporate_transaction (BooleanField) – Marks whether this is a corporate or a personal transaction.
- journal_transaction_id (BigIntegerField) – Journal refID for this transaction.
- class apps.api.models.RefType(*args, **kwargs)¶
This provides descriptions for the diffrent RefTypes.
Parameters: - id (PositiveIntegerField) – Unique refTypeID from API.
- name (TextField) – Name of this refType
- class apps.api.models.Research(*args, **kwargs)¶
Stores research jobs.
Parameters: - id (AutoField) – Id
- character_id (ForeignKey) – Character who owns this job.
- agent_id (ForeignKey) – The agent.
- skill_id (ForeignKey) – The skill used for the research.
- start_date (DateTimeField) – The date the character began the current research with the agent at the current points per day.
- points_per_day (FloatField) – The number of points generated per day.
- remainder_points (FloatField) – The number of points remaining since last datacore purchase and/or points_per_day update.
- class apps.api.models.Skill(*args, **kwargs)¶
This is the global Eve skill tree
Parameters: - id (PositiveIntegerField) – Skill ID from API
- name (TextField) – Name of skill
- group_id (ForeignKey) – FK to skill group
- published (BooleanField) – Published flag
- description (TextField) – description of skill
- rank (PositiveIntegerField) – skill difficulty rank
- primary_attribute (TextField) – Primary attribute for skill
- secondary_attribute (TextField) – secondary attribute for skill
- class apps.api.models.SkillGroup(*args, **kwargs)¶
This is the global eve skill groups
Parameters: - id (PositiveIntegerField) – Group ID from API
- name (TextField) – Name of skill group
auth¶
Views¶
- apps.auth.views.activate(request, key)¶
Handles the activation by activation links which are provided by e-mail
- apps.auth.views.login(request)¶
View for logging users in
- apps.auth.views.logout(request)¶
View for logging users out
- apps.auth.views.register(request)¶
This view handles user registration
- apps.auth.views.registration_success(request)¶
This view is called when the registration succeeded
- apps.auth.views.reset_password(request)¶
View for resetting a user’s password
legacy_api¶
Views¶
- apps.legacy_api.views.marketstat.legacy_marketstat(request)¶
This will match the Eve-central api for legacy reasons
TODO: multiple regions submitted, multiple typeIDs, better error handling
- apps.legacy_api.views.marketstat.marketstat(request)¶
This is our own e43 api export that provides more data than other sites
TODO: multiple regions submitted, multiple typeIDs, better error handling
- apps.legacy_api.views.quicklook.quicklook(request)¶
This is the JSON response object for the API, not E-C safe
TODO: multiple regions submitted, multiple typeIDs, better error handling
manufacturing¶
market_data¶
Models¶
Model definitions for storing market data messages.
- class apps.market_data.models.ActiveOrdersManager¶
Custom manager that only returns active orders.
Example: Get all active orders –> Orders.active.all()
- class apps.market_data.models.ArchivedOrders(*args, **kwargs)¶
Inactive orders, which have been archived automatically.
Parameters: - generated_at (DateTimeField) – When the market data was generated on the user’s machine.
- mapregion_id (ForeignKey) – Region ID the order originated from.
- invtype_id (ForeignKey) – The Type ID of the item in the order.
- price (FloatField) – Item price, as reported in the message.
- volume_remaining (PositiveIntegerField) – Number of remaining items for sale.
- volume_entered (PositiveIntegerField) – Number of items initially put up for sale.
- minimum_volume (PositiveIntegerField) – Minimum volume before the order finishes.
- order_range (IntegerField) – How far the order is visible. 32767 = region-wide
- id (BigIntegerField) – Unique order ID from EVE for this order.
- is_bid (BooleanField) – If True, this is a buy order. If False, this is a sell order.
- issue_date (DateTimeField) – When the order was issued.
- duration (PositiveSmallIntegerField) – The duration of the order, in days.
- stastation_id (ForeignKey) – The station that this order is in.
- mapsolarsystem_id (ForeignKey) – ID of the solar system the order is in.
- is_suspicious (BooleanField) – If this is True, we have reason to question this order’s validity
- message_key (CharField) – The unique hash that of the market message.
- uploader_ip_hash (CharField) – The unique hash for the person who uploaded this message.
- is_active (BooleanField) – is this a live order or is it history
- class apps.market_data.models.ArchivedOrdersManager¶
Custom manager that only returns archived orders.
Example: Get all archived orders –> Orders.archived.all()
- class apps.market_data.models.EmdrStats(*args, **kwargs)¶
Tracking statistics for EMDR messages
Parameters: - id (AutoField) – Id
- status_type (SmallIntegerField) – Message type for statistics
- status_count (PositiveIntegerField) – Count of messages of specific type
- message_timestamp (DateTimeField) – When the stats were counted for this entry
- class apps.market_data.models.EmdrStatsWorking(*args, **kwargs)¶
Tracking statistics for EMDR messages
Parameters: - id (AutoField) – Id
- status_type (SmallIntegerField) – Message type for statistics
- class apps.market_data.models.History(*args, **kwargs)¶
All the history data stored as a compressed JSON message in region/typeID groups
Parameters: - id (CharField) – Primary key, based on UUID
- mapregion_id (ForeignKey) – Region ID the order originated from.
- invtype_id (ForeignKey) – The Type ID of the item in the order.
- history_data (TextField) – Compressed zlib data of the JSON message for history
- class apps.market_data.models.ItemRegionStat(*args, **kwargs)¶
Stats for items on a per region basis processed when new orders come in during warehousing
Parameters: - id (AutoField) – Id
- mapregion_id (ForeignKey) – FK to region table
- invtype_id (ForeignKey) – FK to type table
- buymean (FloatField) – Mean of buy price
- buyavg (FloatField) – Average of buy price
- sellmean (FloatField) – Mean of sell price
- sellavg (FloatField) – Avg of sell price
- buymedian (FloatField) – Median of buy price
- sellmedian (FloatField) – Median of sell price
- buyvolume (BigIntegerField) – total volume traded
- sellvolume (BigIntegerField) – total volume traded
- buy_95_percentile (FloatField) – 95th % of buy orders
- sell_95_percentile (FloatField) – 95th % of sell orders
- buy_std_dev (FloatField) – standard deviation of buy orders
- sell_std_dev (FloatField) – standard deviation of sell orders
- lastupdate (DateTimeField) – Date the stats were updated
- class apps.market_data.models.ItemRegionStatHistory(*args, **kwargs)¶
Stats for items on a per region basis processed when new orders come in during warehousing
Parameters: - id (AutoField) – Id
- mapregion_id (ForeignKey) – FK to region table
- invtype_id (ForeignKey) – FK to type table
- buymean (FloatField) – Mean of buy price
- buyavg (FloatField) – Average of buy price
- sellmean (FloatField) – Mean of sell price
- sellavg (FloatField) – Avg of sell price
- buymedian (FloatField) – Median of buy price
- sellmedian (FloatField) – Median of sell price
- buyvolume (BigIntegerField) – total volume traded
- sellvolume (BigIntegerField) – total volume traded
- buy_95_percentile (FloatField) – 95th % of buy orders
- sell_95_percentile (FloatField) – 95th % of sell orders
- buy_std_dev (FloatField) – standard deviation of buy orders
- sell_std_dev (FloatField) – standard deviation of sell orders
- date (DateTimeField) – Date the stats were inserted
- class apps.market_data.models.OrderHistory(*args, **kwargs)¶
Post-processed history
Parameters: - id (AutoField) – Id
- mapregion_id (ForeignKey) – Region ID the order originated from.
- invtype_id (ForeignKey) – The Type ID of the item in the order.
- date (DateTimeField) – Date of the data
- numorders (PositiveIntegerField) – number of transactions for this item/region
- low (FloatField) – low price of orders for this item/region
- high (FloatField) – high price of orders for this item/region
- mean (FloatField) – mean price of orders for this item/region
- quantity (BigIntegerField) – quantity of item sold for this item/region
- class apps.market_data.models.Orders(*args, **kwargs)¶
A parsed order message with the details broken out into the various fields. This represents a single line in a UUDIF rowset.
Parameters: - generated_at (DateTimeField) – When the market data was generated on the user’s machine.
- mapregion_id (ForeignKey) – Region ID the order originated from.
- invtype_id (ForeignKey) – The Type ID of the item in the order.
- price (FloatField) – Item price, as reported in the message.
- volume_remaining (PositiveIntegerField) – Number of remaining items for sale.
- volume_entered (PositiveIntegerField) – Number of items initially put up for sale.
- minimum_volume (PositiveIntegerField) – Minimum volume before the order finishes.
- order_range (IntegerField) – How far the order is visible. 32767 = region-wide
- id (BigIntegerField) – Unique order ID from EVE for this order.
- is_bid (BooleanField) – If True, this is a buy order. If False, this is a sell order.
- issue_date (DateTimeField) – When the order was issued.
- duration (PositiveSmallIntegerField) – The duration of the order, in days.
- stastation_id (ForeignKey) – The station that this order is in.
- mapsolarsystem_id (ForeignKey) – ID of the solar system the order is in.
- is_suspicious (BooleanField) – If this is True, we have reason to question this order’s validity
- message_key (CharField) – The unique hash that of the market message.
- uploader_ip_hash (CharField) – The unique hash for the person who uploaded this message.
- is_active (BooleanField) – is this a live order or is it history
- class apps.market_data.models.SeenOrders(*args, **kwargs)¶
Track which orders we’ve seen in this last cycle.
Parameters: - id (BigIntegerField) – Order ID
- region_id (PositiveIntegerField) – Region ID of seen order
- type_id (PositiveIntegerField) – Type ID of seen order
- class apps.market_data.models.UUDIFMessage(*args, **kwargs)¶
A raw JSON UUDIF market message. This is typically only used on local development workstations.
Parameters: - id (AutoField) – Id
- key (CharField) – I’m assuming this is a unique hash for the message.
- received_dtime (DateTimeField) – Time of initial receiving.
- is_order (BooleanField) – If True, this is an order. If False, this is history.
- message (TextField) – Full JSON representation of the message.
Views¶
- apps.market_data.views.history_compare_json(request, *args, **kwargs)¶
Returns a set of history data in JSON format. Defaults to Tritanium in The Forge.
- apps.market_data.views.history_json(request, *args, **kwargs)¶
Returns a set of history data in JSON format. Defaults to Tritanium in The Forge.
rest_framework¶
Only contains static assets and templates.
feedreader¶
Models¶
- class apps.feedreader.models.Feed(*args, **kwargs)¶
Holds information about a news-feed which gets updated regularly by a Celery task.
Parameters: - id (AutoField) – Id
- url (URLField) – Newsfeed URL
- name (CharField) – Name of the feed
- icon_file (CharField) – Name of the feed’s icon file
- next_update (DateTimeField) – Timestamp for next update
- class apps.feedreader.models.FeedItem(*args, **kwargs)¶
Holds information about a news item in a news-feed.
Parameters: - id (AutoField) – Id
- feed_id (ForeignKey) – FKey relationship to feed table
- title (CharField) – Title of the item
- description (TextField) – Short description of the item
- link (URLField) – Link to the text
- published (DateTimeField) – Time the item was published