summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Kocherhans <joseph@jkocherhans.com>2007-09-09 19:12:43 +0000
committerJoseph Kocherhans <joseph@jkocherhans.com>2007-09-09 19:12:43 +0000
commit4ccc5ff3e19ce6bb7e1f1cc278a44bc8daee9d85 (patch)
tree674ce0e6c840f25a31e6f984103d9fbede478fb2
parentd9fb3fed869322298518e6d662b3ae56f2054788 (diff)
newforms-admin: Switched edit inline rendering to just use an include instead of a special template tag.
git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@6073 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/contrib/admin/templates/admin/change_form.html4
-rw-r--r--django/contrib/admin/templatetags/admin_modify.py17
2 files changed, 2 insertions, 19 deletions
diff --git a/django/contrib/admin/templates/admin/change_form.html b/django/contrib/admin/templates/admin/change_form.html
index d0cce130db..8a6a4f9414 100644
--- a/django/contrib/admin/templates/admin/change_form.html
+++ b/django/contrib/admin/templates/admin/change_form.html
@@ -62,8 +62,8 @@
{% block after_field_sets %}{% endblock %}
-{% for bound_inline in bound_inlines %}
- {% render_inline bound_inline %}
+{% for inline_admin_formset in inline_admin_formsets %}
+ {% include inline_admin_formset.opts.template %}
{% endfor %}
{% block after_related_objects %}{% endblock %}
diff --git a/django/contrib/admin/templatetags/admin_modify.py b/django/contrib/admin/templatetags/admin_modify.py
index f8ee936c3c..44ee2e55dd 100644
--- a/django/contrib/admin/templatetags/admin_modify.py
+++ b/django/contrib/admin/templatetags/admin_modify.py
@@ -105,20 +105,3 @@ def field_widget(parser, token):
raise template.TemplateSyntaxError, "%s takes 1 argument" % bits[0]
return FieldWidgetNode(bits[1])
field_widget = register.tag(field_widget)
-
-class InlineNode(template.Node):
- def __init__(self, inline_var):
- self.inline_var = inline_var
-
- def render(self, context):
- inline = context[self.inline_var]
- t = loader.get_template(inline.template)
- output = t.render(context)
- return output
-
-def render_inline(parser, token):
- bits = token.contents.split()
- if len(bits) != 2:
- raise template.TemplateSyntaxError, "%s takes 1 argument" % bits[0]
- return InlineNode(bits[1])
-render_inline = register.tag(render_inline)