On Dec 29, 6:42 pm, James Bennett <ubernost...@gmail.com> wrote:
>
> If this really bothers you, it's trivial to set up your own
> contact-form class which collects a subject line as well.

Trivial depending on your level of experience :)

For benefit of others, here's how I solved it:

1) In my own forms definitions, added:

from contact_form.forms import ContactForm

class EnhancedContactForm(ContactForm):
    subject = forms.CharField(label='Subject', required=True)

2) In urls.py, snag /contact/ before django_forms does:

from bucket.forms import EnhancedContactForm

url('^contact/?$', 'contact_form.views.contact_form', {'form_class':
EnhancedContactForm, }),
(r'^contact/', include('contact_form.urls')),

That's all there was to it.  Only snag now is that the "subject" field
shows up at the end of the form rather than the top - need to figure
out how to control field ordering in subclassed forms.

Thanks all.

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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.


Reply via email to