Re: Setting a default value for a select widget in a modelformset

2010-09-05 Thread Roald de Vries
On Sep 2, 2010, at 4:41 PM, Steve McConville wrote: What would be the best way to go about this? Is it necessary to create a custom widget to achieve this? I guess the best way would be to use the 'initial' parameter. http://docs.djangoproject.com/en/dev/topics/forms/formsets/#using-initial-dat

Setting a default value for a select widget in a modelformset

2010-09-02 Thread Steve McConville
We have a modelformset created like this: DocumentFormSet = modelformset_factory(Document, extra=0, fields=('name', 'category') with a models.py like this: class Category(models.Model): name = CharField(max_length=100) # other stuff class Document(models.Model): name = CharField(max