2023-10-20 07:25:55 +00:00
|
|
|
from www.summit_registration.models import SummitRegistration
|
2023-10-19 22:52:39 +00:00
|
|
|
from django import forms
|
|
|
|
from django.shortcuts import render
|
|
|
|
|
2010-09-26 21:32:53 +00:00
|
|
|
|
|
|
|
def register(request):
|
|
|
|
"""Summit registration form view
|
|
|
|
"""
|
|
|
|
|
|
|
|
class SummitForm(ModelForm):
|
2023-09-07 13:15:48 +00:00
|
|
|
class Meta:
|
2010-09-26 21:32:53 +00:00
|
|
|
model = SummitRegistration
|
|
|
|
|
|
|
|
SummitForm.base_fields['email'].label = 'Email address'
|
|
|
|
SummitForm.base_fields['phone'].label = 'Phone number'
|
|
|
|
SummitForm.base_fields['address'].label = 'Mailing address'
|
|
|
|
SummitForm.base_fields['cle_credit'].label = 'Attending for CLE credit?'
|
|
|
|
|
|
|
|
if request.method == 'POST':
|
|
|
|
form = SummitForm(request.POST)
|
|
|
|
if form.is_valid():
|
|
|
|
form.save()
|
2017-11-03 15:58:24 +00:00
|
|
|
return render(reqeust, 'summit_registration/register_success.html', {'form': form.cleaned_data})
|
2010-09-26 21:32:53 +00:00
|
|
|
else:
|
|
|
|
form = SummitForm()
|
|
|
|
|
2017-11-03 15:58:24 +00:00
|
|
|
return render(request, 'summit_registration/register.html', {'form': form})
|