Heyo Django Users,
I'm in a bit of a pickle with InlineFormsets -
I'm following the example at the Django Docs:
http://docs.djangoproject.com/en/dev/topics/forms/modelforms/#using-inlineformset-factory
I've got two models:
--------------------
class Author(models.Model):
name = models.CharField(max_length=100)
class Book(models.Model):
author = models.ForeignKey(Author)
title = models.CharField(max_length=100)
description = models.CharField(max_length=255)
--------------------
And I want to have an inline formsets to edit authors & books inline.
What I want to do is just show the title field of the Book so I have
a custom ModelForm for that:
--------------------
class BookModelForm(forms.ModelForm):
class Meta:
model = Book
fields = ('title',)
--------------------
Everything looks good, I'm all ready to construct my
inlinemodelformset using inlineformset_factory...
--------------------
from django.forms.models import inlineformset_factory
# ???
BookFormSet = inlineformset_factory(Author, Book)
--------------------
And doh! inlineformset_factory doesn't seem to want to let me set the
form for the inline model.
http://code.djangoproject.com/browser/django/trunk/django/forms/models.py
Anyone have any luck with this?
Thanks,
John