Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing: Deprecation warnings when used with Django 1.9 #77 #82

Merged
merged 2 commits into from Apr 26, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion bootstrapform/templatetags/bootstrap.py
@@ -1,4 +1,4 @@
from django import forms
from django import forms, VERSION as django_version
from django.template import Context
from django.template.loader import get_template
from django import template
Expand Down Expand Up @@ -77,6 +77,9 @@ def render(element, markup_classes):
template = get_template("bootstrapform/form.html")
context = Context({'form': element, 'classes': markup_classes})

if django_version >= (1, 8):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is over-indented

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. If the element_type is "boundfield", then the error in the issue description occurs because this fix does not get applied. Would be nice if we could get a new release with this fix.

context = context.flatten()

return template.render(context)


Expand Down
3 changes: 2 additions & 1 deletion tox.ini
@@ -1,5 +1,5 @@
[tox]
envlist = {py27,py34}-dj{15,16,17,18}
envlist = {py27,py34}-dj{15,16,17,18,19}
skipsdist=True


Expand All @@ -13,6 +13,7 @@ deps =
dj16: django>=1.6,<1.7
dj17: django>=1.7,<1.8
dj18: django>=1.8,<1.9
dj19: django>=1.9,<1.10
commands = python setup.py test


Expand Down