From the category archives:

forms

Doing things with Django forms

by shabda on January 14, 2010

Forms are one of the best features of Django. (After models, admin, url routing etc ). Here is a quick tutorial describing how to do things with Django forms.

Basic form

Prob. You want to show a form, validate it and display it.

Ans. Create a simple form.

class UserForm(forms.Form): username = forms.CharField() [...]

{ 40 comments }

Dynamic forms with Django

by shabda on October 10, 2008

Newforms, (or forms now) are without doubt one of the coolest features of Django. (Of course after Admin, Localflavor, and many others). Here is some sample code.

class EmployeeForm(forms.Form): name = forms.CharField() age = forms.IntegerField() resume = forms.FileField()

Just this code gives you

A form which knows how to [...]

{ 11 comments }