> Hello,
>
> I have a modelform with a model which include a models.many_to_many field.
> By default the modelform represents those m2m entries with a
> multiplechoice field
>
> http://docs.djangoproject.com/en/dev/topics/forms/modelforms/
> example:
> tag_set = forms.ModelMultipleChoiceField(queryset=Tag.objects.all())
>
> 1/ when I initialize my model form (form(instance=defaultinstance)), I
> would like the m2m entries to
> appear as a form.TextInput with default value of defaultinstance.tag_set.all()
>
Here the question how do I get the defaultinstance tags?
Maybe self.instance.tag_set.all() ?!?!?
How do I populate my widget?
forms.TextInput(attrs={'size':70}, default=????????),
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
No comments:
Post a Comment