2010-09-26 21:32:53 +00:00
|
|
|
from django.shortcuts import render_to_response
|
2015-12-01 02:49:50 +00:00
|
|
|
from django.template import RequestContext
|
2010-09-26 21:32:53 +00:00
|
|
|
from django import forms
|
2015-12-01 02:49:50 +00:00
|
|
|
from django.template import RequestContext
|
2015-03-09 00:54:05 +00:00
|
|
|
from conervancy.apps.summit_registration.models import SummitRegistration
|
2010-09-26 21:32:53 +00:00
|
|
|
|
|
|
|
def register(request):
|
|
|
|
"""Summit registration form view
|
|
|
|
"""
|
|
|
|
|
|
|
|
class SummitForm(ModelForm):
|
|
|
|
class Meta:
|
|
|
|
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()
|
|
|
|
return render_to_response('summit_registration/register_success.html',
|
2015-12-01 02:49:50 +00:00
|
|
|
{'form': form.cleaned_data}, context_instance=RequestContext(request))
|
2010-09-26 21:32:53 +00:00
|
|
|
else:
|
|
|
|
form = SummitForm()
|
|
|
|
|
|
|
|
return render_to_response('summit_registration/register.html',
|
2015-12-01 02:49:50 +00:00
|
|
|
{'form': form}, context_instance=RequestContext(request))
|