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 ...
Updated 11/17/10 @ 09:52AM CST by jjasinski