Re: inline forms/subforms: how to use inlineformset_factory ?

2008-12-02 Thread Dominic Ashton
> > I did read this documentation, and was confused because I read this: > > >>> from django.forms.models import inlineformset_factory > >>> BookFormSet = inlineformset_factory(Author, Book) > >>> author = Author.objects.get(name=u'Orson Scott Card') > >>> formset = BookFormSet(instance=author >

Re: inline forms/subforms: how to use inlineformset_factory ?

2008-12-02 Thread Dominic Ashton
> > Did you happen to read the official Django documentation on model > formsets? In model formsets there are two factory functions. > modelformset_factory and inlineformset_factory. The latter is a subset > of the former and makes it easier to work with related objects through > a foreign key. T

inline forms/subforms: how to use inlineformset_factory ?

2008-11-29 Thread Dominic Ashton
Hi all, I've been working fruitlessly all day attempting what I though would be a simple task: Adding a sub form/inline form so that I can have two related forms displaying on the same page tied to models in a one-to- many relationship. This was very easy to do in the admin, but now I am attempt

Re: Using list_filter with a foreign key field in the Admin

2008-11-20 Thread Dominic Ashton
Guys, A brief google search has led me to conclude that it's not possible to filter on a foreign key field in the Admin. Can anyone explain the design rationale around that? Filtering by anything but a foreign key value is usuless in many of my models. To give you a concrete example: I have a Pro

Re: Non-ASCII character - strange error

2008-11-19 Thread Dominic Ashton
Guys, Just had the strangest thing happened. Finished working on my project last night and everything was working fine. I backed up the directory using tar, log on today and start my development server and get the following error message: Traceback (most recent call last): File "manage.py",