Custom edit_inline class broken?

2 views
Skip to first unread message

andre...@gmail.com

unread,
May 27, 2006, 10:58:00 AM5/27/06
to Django users
According to http://code.djangoproject.com/wiki/NewAdminChanges
creating a custom variant of the edit_inline form should be possible by
creating a class which overrides BoundRelatedObject. I tried this,
creating a really silly class which does very little, just to see if I
could get it working, but nothing seemed to happen. So I looked at the
code, and in admin_modify.py I found this:

class EditInlineNode(template.Node):
...
if relation.field.rel.edit_inline == models.TABULAR:
bound_related_object_class = TabularBoundRelatedObject
else:
bound_related_object_class = StackedBoundRelatedObject

Which explains the behavior I'm seeing --- that no matter what I pass
as a parameter to edit_inline, I get the stacked variant (except for 1,
which is the value of the TABULAR constant)

So, looking at the revision log, I found that this code was changed in
changeset 2809, which was apparently some magic removal update.
(http://code.djangoproject.com/changeset/2809#file62) The old code was
this:

156 klass = relation.field.rel.edit_inline
157 bound_related_object_class =
bound_related_object_overrides.get(klass, klass)

which seems more in line with the docs I found.

Anyway, skimming http://code.djangoproject.com/wiki/RemovingTheMagic
gave me no answer regarding why this has been changed, and what I
should do now.

So, I can't create a custom edit_inline_stacked.html template, nor can
I override BoundRelatedObject. Is there any way I can get custom inline
editing, or will I have to ditch the admin altogether and write my
admin interface from scratch?

Reply all
Reply to author
Forward
0 new messages