Forms#

StakingForm is a ModelForm with the following extras:

  • An attachments field (MultipleFileField) with delete-while-editing support.

  • The item queryset is restricted to coins (Item.objects.filter(coin__isnull=False)).

  • The transaction queryset is restricted to open, coin-related transactions belonging to the current user.

Validators#

  • amount and reward_amount must be >= 0.

  • start <= today.

  • start < end.

  • If a related transaction is set, start >= transaction.date.