I take it back.

I over thought it -

Instead of using a custom inline form model just pass the parameters
directly to inlineformset_factory as per it's spec:
def inlineformset_factory(parent_model, model, form=ModelForm,
                                  formset=BaseInlineFormSet, fk_name=None,
                                  fields=None, exclude=None,
                                  extra=3, can_order=False, can_delete=True,
max_num=0,
                                  formfield_callback=lambda f:
f.formfield()):

On Nov 10, 12:47 pm, John Boxall <[EMAIL PROTECTED]> wrote:
> 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-i...
>
> 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/model...
>
> Anyone have any luck with this?
>
> Thanks,
>
> John
--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to