Models#

Staking record#

The main staking record. Tracks the staked item, exchange, start / end dates, the amount staked, the reward, an optional originating transaction, a free-form note, and a sold flag.

class richy.staking.models.Staking(id, user, item, exchange, start, end, amount, reward_amount, transaction, note, is_sold)[source]#

Bases: UserRelatedModel

exception DoesNotExist#

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned#

Bases: MultipleObjectsReturned

delete(*args, **kwargs)[source]#

Removes whole attachments dir.

Attachment#

Per-staking file attachments. Files live under MEDIA_ROOT/staking/<staking_pk>/; deleting a Staking row also wipes its attachment directory.

class richy.staking.models.Attachment(id, staking, file)[source]#

Bases: Model, AttachmentMixin

exception DoesNotExist#

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned#

Bases: MultipleObjectsReturned

Managers and querysets#

StakingManager and StakingQuerySet extend UserRelatedManager / UserRelatedQuerySet (see Models) with the convenience filters open(), closed(), sold() and not_sold().

  • openend >= today

  • closedend < today

  • soldis_sold = True

  • not_soldis_sold = False

class richy.staking.models.StakingQuerySet(model=None, query=None, using=None, hints=None)[source]#

Bases: UserRelatedQuerySet

class richy.staking.models.StakingManager(*args, **kwargs)[source]#

Bases: UserRelatedManager