I'm Ross. These are my blog posts tagged forms.

Dynamic ModelForms in Django

Posted 7:22 p.m., Monday 15 December, 2008. Tagged django, forms, modelform and newforms

Since 'newforms' became the norm within Django, there seems to have been some confusion relating to dynamic forms that relate specifically to a model.

The basic way to handle forms is to use a ModelForm for simple single-model-related forms, and Form instances for everything else, including more advanced Model-based forms. Many people seem to forget, however, that a ModelForm or Form instance can be manipulated after it's created.

In this blog post, I have included a design pattern I've recently used that should be of use to others who want to tweak their ModelForm instances at runtime.

More...

Want to see more? Check out the yearly archives below.