Fix PendingDeprecationWarning for cycle tag on Django 1.6+

This commit is contained in:
medmunds
2014-04-20 14:43:59 -07:00
parent 76a90cdf04
commit 28c5a3a742
5 changed files with 22 additions and 0 deletions

View File

@@ -1,6 +1,8 @@
{% extends "admin/base_site.html" %}
{% load admin_list i18n %}
{% load url from future %}
{% load cycle from djrill_future %}
{% block extrastyle %}
{{ block.super }}
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}admin/css/changelists.css" />

View File

@@ -1,6 +1,8 @@
{% extends "admin/base_site.html" %}
{% load admin_list i18n %}
{% load url from future %}
{% load cycle from djrill_future %}
{% block extrastyle %}
{{ block.super }}
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}admin/css/changelists.css" />

View File

@@ -1,6 +1,8 @@
{% extends "admin/base_site.html" %}
{% load admin_list i18n %}
{% load url from future %}
{% load cycle from djrill_future %}
{% block extrastyle %}
{{ block.super }}
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}admin/css/changelists.css" />

View File

View File

@@ -0,0 +1,16 @@
# Future templatetags library that is also backwards compatible with
# older versions of Django (so long as Djrill's code is compatible
# with the future behavior).
from django import template
# Django 1.8 changes autoescape behavior in cycle tag.
# Djrill has been compatible with future behavior all along.
try:
from django.templatetags.future import cycle
except ImportError:
from django.template.defaulttags import cycle
register = template.Library()
register.tag(cycle)