Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Ported over to Python 2.4

  • Loading branch information...
commit 76645aa8bf355734f448f364cd1a266dcf367f52 1 parent 33dfe2c
@arsatiki arsatiki authored jacobian committed
Showing with 7 additions and 5 deletions.
  1. +1 −1  README
  2. +6 −4 googlecharts/templatetags/charts.py
View
2  README
@@ -6,7 +6,7 @@ This is a suite of template tags to assist in generating charts using Google's
for that.
Currently the library is long on code, and short on testing and documentation.
-It's only been tested against Django 1.1 and Python 2.5.
+It's only been tested against Django 1.1 and Pythons 2.4 and 2.5.
For example usage, see ``docs/examples.html``.
View
10 googlecharts/templatetags/charts.py
@@ -1,6 +1,5 @@
import sys
import inspect
-import functools
import colorsys
from django import template
@@ -892,9 +891,12 @@ def smart_join(sep, *args):
def urlencode(query, safe="/:,|"):
'''Omit any options that begin with _; for internal use'''
- q = functools.partial(quote_plus, safe=safe)
- query = query.items() if hasattr(query, "items") else query
- qlist = ["%s=%s" % (q(k), q(v)) for (k,v) in query if not k.startswith('_')]
+
+ if hasattr(query, "items"):
+ query = query.items()
+
+ qlist = ["%s=%s" % (quote_plus(k, safe=safe), quote_plus(v, safe=safe))
+ for (k,v) in query if not k.startswith('_')]
return "&".join(qlist)
def flatten(iterator):
Please sign in to comment.
Something went wrong with that request. Please try again.