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?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---