Chicago Django/Python Blog - Imaginary Landscape

Django Form Snippets

November 17, 2010 9:52 a.m.

Django forms are very convenient tools for Django development, but sometimes I find myself wrangling with them to get them to do what I want them to do.  I’ve compiled a few simple form examples that I find useful for various form-related tasks.

Say you have a model that looks like this:

Example 1:
class MyModel(models.Model):
  myfield1= models.CharField(u'Field 1 Name', help_text='Field 1 help',
                            max_length=20, blank=True)
  myfield2 = models.CharField(u'Field 2 Name', help_text='Field 2 help',
                            max_length=20, blank=True)

As we know, generating a basic ModelForm for this model is ...

Read More


Updated 11/17/10 @ 09:52AM CST by jjasinski

Bookmark and Share

Categories: Django Python

Tags: django forms python


Django Multiple Page Forms

December 14, 2009 11:13 a.m.

I recently started working on another new project here at Imaginary Landscape, and this one looked rather enticing as it threw some stuff my way that I haven't had a chance to play with much recently. First on that chopping block was a multi-page registration form application. Immediately I remembered reading about Django's Form Wizard module and thought it'd be a great way to handle this small application. At least I thought so until I finished reading the specifications for the project and realized that the user must be able to move both backwards and forwards through ...

Read More


Updated 12/14/09 @ 11:13AM CST by markr

Bookmark and Share

Categories: Django

Tags: django forms


(877) 275-9144 Toll Free | M-F:9-5

Imaginary Landscape, LLC 5121 North Ravenswood Avenue Chicago, Illinois 60640