17 lines
295 B
Python
17 lines
295 B
Python
|
from django import forms
|
||
|
from .models import Ticket, TicketType
|
||
|
|
||
|
|
||
|
class TicketForm(forms.ModelForm):
|
||
|
|
||
|
class Meta:
|
||
|
model = Ticket
|
||
|
fields = [
|
||
|
'ticket_type',
|
||
|
]
|
||
|
|
||
|
ticket_type = forms.ModelChoiceField(
|
||
|
queryset=TicketType.objects.available()
|
||
|
)
|
||
|
|