daily pastebin goal
65%
SHARE
TWEET

Untitled

a guest Feb 19th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class RegistrationForm(SignupFormOnlyEmail):
  2.  
  3.     first_name = forms.CharField(label='First Name', max_length=30, required=True, error_messages={'required':'Please Provide Your First Name'})
  4.     last_name = forms.CharField(label='Last Name', max_length=30, required=True)
  5.     email2 = forms.EmailField(widget=forms.TextInput(attrs=dict(attrs_dict, maxlength=75)), label=_("Retype Email"), required=True)
  6.     parent_type = forms.ChoiceField(label="I am a", choices=ACCOUNT_TYPES, widget=forms.RadioSelect)
  7.     child_count = forms.ChoiceField(label="My Kids", choices=KID_CHOICES, widget=forms.Select)
  8.     grade = forms.ChoiceField(label="My Classroom", choices=GRADE_CHOICES, widget=forms.Select)
  9.     tos = forms.BooleanField(label="I accept the Terms of Use.", required=True)
  10.  
  11.     def __init__(self, *args, **kwargs):
  12.  
  13.         self.initial = kwargs.pop('initial', None)
  14.         kidCount = self.initial['child_count']
  15.         account_type = self.initial['parent_type']
  16.  
  17.         super(RegistrationForm, self).__init__(*args, **kwargs)
  18.    
  19. url(r'^membership/signup/$', signup_view, name='userena_signup'),
  20.    
  21. def signup_view(request):
  22.  
  23.     form = RegistrationForm(initial={'parent_type':request.session['parent_type'],'child_count':request.session['child_count']})
  24.     response = userena_views.signup(request,  signup_form=form, extra_context={'section':'Membership','pagetitle':'Sign Up'})
  25.     return response
  26.    
  27. form = RegistrationForm(initial={'parent_type':request.session['parent_type'],'child_count':request.session['child_count']})
  28. response = userena_views.signup(request,  signup_form=form, extra_context={'section':'Membership','pagetitle':'Sign Up'})
  29.    
  30. response = userena_views.signup(request,  signup_form=RegistrationForm, extra_context={'section':'Membership','pagetitle':'Sign Up'})
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top