On 11/5/05, Le Roux Bodenstein <[EMAIL PROTECTED]> wrote: > Let's say I have two types of objects (types A and B) and object A has > many object Bs. (typical foreign key) > > Is there a way to tell the admin interface to add a little plus button > (either in the listing or edit view for object As) for quickly and > easily adding a new object of type B? In other words it will > pre-select the right object of type A in the select box on the object > B add form.
Yes! If I understand you correctly, Django already does exactly that. It puts a little plus button next to select boxes (for foreign-key fields), which lets you add a foreign-key object. This appears on the add and change forms. The catch is that the foreign-key object needs to have "admin" set in its model, and the currently-logged-in admin user needs to have permission to add those foreign-key objects. Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org