mirror of
https://github.com/django/django.git
synced 2025-07-04 09:49:12 +00:00
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
This commit is contained in:
parent
d9fb3fed86
commit
4ccc5ff3e1
@ -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 %}
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user