From ec561abde8635995c430450e18e2f61b3398865d Mon Sep 17 00:00:00 2001 From: jonesnc Date: Thu, 6 Apr 2017 14:54:45 -0600 Subject: [PATCH] Addresses issue #3: Don't create a Context object directly, since starting with Django 1.11 passing a Context instance raises a TypeError. --- materialize_forms/templatetags/materialize.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/materialize_forms/templatetags/materialize.py b/materialize_forms/templatetags/materialize.py index e131c0d..7dca1d9 100644 --- a/materialize_forms/templatetags/materialize.py +++ b/materialize_forms/templatetags/materialize.py @@ -19,7 +19,6 @@ def add_css_class_widget(widget, css_class): @register.filter def as_material(field, col='s6'): - try: widget = field.field.widget except: @@ -50,13 +49,11 @@ def as_material(field, col='s6'): else: input_type = u'default' - return get_template("materialize/field.html").render( - Context({ - 'field': field, - 'col': col, - 'input_type': input_type, - }) - ) + return get_template("materialize/field.html").render({ + 'field': field, + 'col': col, + 'input_type': input_type, + }) @register.filter @@ -65,5 +62,3 @@ def html_attrs(attrs): for name, value in attrs.items(): pairs.append(u'%s="%s"' % (escape(name), escape(value))) return mark_safe(u' '.join(pairs)) - -