Skip to content

Commit 1d7cf79

Browse files
committed
Localise Django 1.3 dependency to Table.as_html
1 parent 5fe3241 commit 1d7cf79

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

django_tables2/tables.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
from django.utils.datastructures import SortedDict
77
from django.template import RequestContext
88
from django.template.loader import get_template
9-
from django.test.client import RequestFactory
109
from django.utils.encoding import StrAndUnicode
1110
import itertools
1211
import sys
@@ -277,6 +276,8 @@ def as_html(self):
277276
generated will clobber the querystring of the request. Use the
278277
``{% render_table %}`` template tag instead.
279278
"""
279+
# minimizes Django 1.3 dependency
280+
from django.test.client import RequestFactory
280281
request = RequestFactory().get('/')
281282
template = get_template(self.template)
282283
return template.render(RequestContext(request, {'table': self}))

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy