I have a model like below.
class Content(SimpleModel):
title = models.CharField(max_length=255)
body = models.TextField()
slug = models.SlugField(max_length=50)
def __unicode__(self):
return self.title
class MediumStuff(models.Model):
meta_value = models.TextField()
meta_key = models.SlugField('Field Name', max_length=50, blank=True)
content = models.ForeignKey(Content)
def __unicode__(self):
return self.slug
class SmallStuff(models.Model):
text = models.CharField(max_length=60, blank=True, null=True)
content = models.ForeignKey(Content)
What I wanna do is to create formset for content that has inline forms for models of MediumStuff and SmallStuff using inlineformset_factory()
I referred to Django Documentation, but they have a example of how to work with single foreign key model.
ContentFormSet = inlineformset_factory(Content, [MediumStuff, SmallStuff])
nor
ContentFormSet = inlineformset_factory(Content, (MediumStuff, SmallStuff))
didn't work.
Since it is possible to add multiple inlines to admin, I believe this can be done :)
Do you have any suggestion / any resources or tips? Or possibly tell me where I should look at to see how admin handles multiple inlines?