symposion_app/pinaxcon/registrasion/forms.py
Joel Addison 2a720bd46b Tickets for LCA2021
Disable lots of inventory that does not exist for a virtual conf.
Add Swag Badge category and product.
Adjust attendee profile to hide irrelevant questions.
2020-11-23 22:22:00 +10:00

37 lines
952 B
Python

from pinaxcon.registrasion import models
from django import forms
class YesNoField(forms.TypedChoiceField):
def __init__(self, *args, **kwargs):
kwargs['required'] = True
super(YesNoField, self).__init__(
*args,
coerce=lambda x: x in ['True', 'Yes', True],
choices=((None, '--------'), (False, 'No'), (True, 'Yes')),
**kwargs
)
class ProfileForm(forms.ModelForm):
''' A form for requesting badge and profile information. '''
required_css_class = 'label-required'
class Meta:
model = models.AttendeeProfile
exclude = [
'attendee',
'of_legal_age',
'dietary_restrictions',
'children',
'future_conference',
]
widgets = {
'past_lca': forms.widgets.CheckboxSelectMultiple
}
field_classes = {
"of_legal_age": YesNoField,
}