Re: Django form(s) for intermediary models

2011-01-26 Thread aa56280
Wow, that is bananas, Ian. I'll give your solution a try and see what happens. -- 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 dja

Re: Django form(s) for intermediary models

2011-01-26 Thread Ian Lewis
Hi, What you want to do here is use a Django "Formset" which contains your ModelForms. Since you want to show one form per person regardless of whether they are a member or not we can't use the modelformset_factory() and will have to do some manipulation of the initial data using the formset_facto

Re: Django form(s) for intermediary models

2011-01-25 Thread aa56280
> In your case it would become something like: > > class Membership(ModelForm): >         class Meta: >                 model = Membership >                 fields = ('person', 'date_joined') >                 widgets = { >                         'person' : CheckBox(), >                         'd

Re: Django form(s) for intermediary models

2011-01-25 Thread Jonas Geiregat
> In that form, I'd > like to see a checkbox for each Person (member) and a text field for > 'date_joined'. Anyway to do this? You can create forms from models. See this page for more information: http://docs.djangoproject.com/en/dev/topics/forms/modelforms/ You can always override the default

Django form(s) for intermediary models

2011-01-25 Thread aa56280
I have three models like so: class Person(models.Model): name = models.CharField(max_length=128) class Group(models.Model): name = models.CharField(max_length=128) members = models.ManyToManyField(Person, through='Membership') class Membership(models.Model): person = models.ForeignKey(Pe