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. .. autoclass:: richy.staking.models.Staking :members: :show-inheritance: Attachment ---------- Per-staking file attachments. Files live under ``MEDIA_ROOT/staking//``; deleting a ``Staking`` row also wipes its attachment directory. .. autoclass:: richy.staking.models.Attachment :members: :show-inheritance: Managers and querysets ---------------------- ``StakingManager`` and ``StakingQuerySet`` extend :class:`~richy.core.models.UserRelatedManager` / :class:`~richy.core.models.UserRelatedQuerySet` (see :doc:`/modules/core/models`) with the convenience filters ``open()``, ``closed()``, ``sold()`` and ``not_sold()``. * **open** -- ``end >= today`` * **closed** -- ``end < today`` * **sold** -- ``is_sold = True`` * **not_sold** -- ``is_sold = False`` .. autoclass:: richy.staking.models.StakingQuerySet :show-inheritance: .. autoclass:: richy.staking.models.StakingManager :show-inheritance: