manage coupons list, add, edit, delete views
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
from django import forms
|
||||
from accounts.models import IAmPrincipalType
|
||||
from manage_subscriptions.models import PrincipalSubscription, Subscription, Plan
|
||||
|
||||
|
||||
@@ -31,7 +32,15 @@ class SubscriptionForm(forms.ModelForm):
|
||||
"active",
|
||||
"deleted",
|
||||
"is_free",
|
||||
] # Include all fields you want from the model
|
||||
]
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(SubscriptionForm, self).__init__(*args, **kwargs)
|
||||
event_user = IAmPrincipalType.objects.get(name="event_user")
|
||||
event_manager = IAmPrincipalType.objects.get(name="event_manager")
|
||||
self.fields["principal_types"].queryset = IAmPrincipalType.objects.filter(
|
||||
id__in=[event_user.id, event_manager.id]
|
||||
)
|
||||
|
||||
|
||||
class PrincipalSubscriptionForm(forms.ModelForm):
|
||||
|
||||
Reference in New Issue
Block a user