I generate forms based on a modelform that references primary keys
from different models in my app. A nested tuple is used to reference
these primary keys; the modelform can reference these primary keys
along with other values submitted from the form.
I want to send pickled data of a nested tupl
Can I change a ModelForms widget attrs?
My model form:
class Disco(ModelForm):
class Meta:
model = Dance
I want to change the form widget of pickup_lines which is
pickup_lines = models.ManyToManyField(WittyThings)
in models.py
I would like to edit this model form widget like:
Nevermind; I got it:
class Disco(ModelForm):
pickup_lines = forms.ModelMultipleChoiceField(required=True,
queryset=WittyThings.objects.all(), \
widget=forms.SelectMultiple(attrs={'size': '10'}) )
class Meta:
model = Dance
-sg
On Dec 15, 8:40 am, stuntgo
3 matches
Mail list logo