Hello everybody,

I was wondering if it's possible to insert a Model formset inside
another ModelForm.
Let me explain myself:

here are my models:

class Publication(models.Model):
    author = models.CharField(...)
    content = models.TextField()
    ...

class Document(models.Model):
    file = models.FileField(...)
    publication = models.ForeignKey(Publication)

I declared a ModelForm in order to add/edit Publication:

class PublicationForm(ModelForm):
    class Meta:
        model = Publication

I know how to declare a Model formset to add/edit files:
DocumentFormSet = inlineformset_factory(Publication, Document)

So I know have two forms and I just want one form.
Is it possible to simply add the inline formset to PublicationForm ?

Thank you in advance,

regards,

Gontran

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to