AdminReferralReward
| Field | Type | Constraints |
|---|---|---|
id |
BigAutoField | PK |
account |
OneToOne → Account | nullable |
global_reward |
BooleanField | default=False |
account_usernames |
TextField | nullable |
reason |
CharField(250) | choicesAdminReferralRewardReason |
comment |
TextField | nullable |
admin_user |
FK → User | nullable |
expiration |
DateTimeField | nullable |
sender_amount |
PositiveIntegerField | nullable |
recipient_amount |
PositiveIntegerField | nullable |
referral_reward_spend_threshold |
PositiveIntegerField | nullable |
award_spin_amount |
PositiveIntegerField | nullable |
sender_currency |
CharField(250) | choices default=valueReferralSupportCurrencies |
recipient_currency |
CharField(250) | choices default=valueReferralSupportCurrencies |
Sample Queries (click to expand)
Get all records
AdminReferralReward.objects.all()
Get by ID
AdminReferralReward.objects.get(id=1)
With related Account
AdminReferralReward.objects.select_related("account")
Filter by account
AdminReferralReward.objects.filter(account_id=123)
Filter by expiration (last 7 days)
AdminReferralReward.objects.filter(expiration__gte=datetime.now()-timedelta(days=7))