If I remember this correctly, there's a variable somewhere in django-registration that defines the form to be used.
grep (or ack!) the source for RegistrationForm and see if you can find it Cheers, Andre On 7/8/11, katstevens <kat.stev...@gmail.com> wrote: > Thanks for your answer, but unfortunately that hasn't helped - on > further investigation I think the problem is somewhere else, as the > original RegistrationForm class instance (in registration.forms) > doesn't seem to be being called correctly by registration.views (so no > wonder RegistrationFormTermsOfService isn't working!). I tried making > some small changes to the labels in the RegistrationForm class and it > is still displaying the default label values in my template. For > example, the class declaration now looks like: > > class RegistrationForm(forms.Form): > # all the other fields > # ... > password1 = > forms.CharField(widget=forms.PasswordInput(attrs=attrs_dict, > render_value=False), > label=_(u'different password label')) > > In registration.views I've imported the form as follows > > from registration.forms import RegistrationForm > > And used the default view declaration: > > def register(request, success_url=None, > form_class=RegistrationForm, profile_callback=None, > template_name='registration/registration_form.html', > extra_context=None): > if request.method == 'POST': > # do post stuff > else: > # instantiate blank form > form = form_class() > > Finally, on the registration_form.html template I've tried calling the > fields explicitly rather than using the form.as_table tag: > > <td>{{ form.password1.label_tag }}</td> > <td>{{ form.password1 }}</td> > > The page displays these fields fine, yet the label still gives the > default label value of 'password' instead of 'different password > label'. I'm not getting any syntax errors, and I've rebooted my server > for good measure with the same results. Therefore I assume that either > form = form_class() isn't actually instantiating RegistrationForm > properly in the view, or there is some sort of overriding default > being called from a different location (maybe django.contrib.auth?). > > Also - I can't see the form_call field that you mention - does this > refer to the parameter 'form_class=RegistrationForm' I've used above > in my registration view? > > Thanks again! > > On Jul 8, 7:08 am, CareerDhaba tech <t...@careerdhaba.com> wrote: >> Hi Kat, >> >> You have to tell the your registration view to use the >> RegistrationFormTermsofService. First, import that class from forms and >> change your form_call from None to to RegistrationFormTermsofService. >> >> Hope this helps. >> >> >> >> >> >> >> >> On Thu, Jul 7, 2011 at 5:34 PM, katstevens <kat.stev...@gmail.com> wrote: >> > Hi - I'm new to Django and am using django-registration to set up new >> > users. >> >> > The basic RegistrationForm shows up fine in my template (which just >> > uses {{ form.as_table }} to generate fields inside the form HTML), but >> > I now want to use the RegistrationFormTermsOfService subclass instead. >> >> > I set it as a parameter in urls.py as follows: >> > url(r'^register/$', >> > register, >> > {'form_class': >> > RegistrationFormTermsOfService}, >> > name='registration_register'), >> >> > ... but the original RegistrationForm is still showing instead. Any >> > ideas why this would be? Do I have to remove the default 'form_class' >> > value in the register declaration in views.py (as that still gives >> > RegistrationForm as the default)? Or do I need to alter my template? >> >> > I'm sure I'm missing something really obvious - any help gratefully >> > received. >> >> > Kat >> >> > -- >> > You received this message because you are subscribed to the Google >> > Groups >> > "Django users" group. >> > To post to this group, send email to django-users@googlegroups.com. >> > To unsubscribe from this group, send email to >> > django-users+unsubscr...@googlegroups.com. >> > For more options, visit this group at >> >http://groups.google.com/group/django-users?hl=en. > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- Sent from my mobile device -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.