Merge pull request #82 from hugoleodev/master

Fixing: Deprecation warnings when used with Django 1.9 #77
This commit is contained in:
tzangms 2016-04-26 00:22:43 -05:00
commit ab0b59e913
2 changed files with 6 additions and 2 deletions

View File

@ -1,4 +1,4 @@
from django import forms from django import forms, VERSION as django_version
from django.template import Context from django.template import Context
from django.template.loader import get_template from django.template.loader import get_template
from django import template from django import template
@ -77,6 +77,9 @@ def render(element, markup_classes):
template = get_template("bootstrapform/form.html") template = get_template("bootstrapform/form.html")
context = Context({'form': element, 'classes': markup_classes}) context = Context({'form': element, 'classes': markup_classes})
if django_version >= (1, 8):
context = context.flatten()
return template.render(context) return template.render(context)

View File

@ -1,5 +1,5 @@
[tox] [tox]
envlist = {py27,py34}-dj{15,16,17,18} envlist = {py27,py34}-dj{15,16,17,18,19}
skipsdist=True skipsdist=True
@ -13,6 +13,7 @@ deps =
dj16: django>=1.6,<1.7 dj16: django>=1.6,<1.7
dj17: django>=1.7,<1.8 dj17: django>=1.7,<1.8
dj18: django>=1.8,<1.9 dj18: django>=1.8,<1.9
dj19: django>=1.9,<1.10
commands = python setup.py test commands = python setup.py test