Skip to content

Commit

Permalink
Ported over to Python 2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
arsatiki authored and jacobian committed Feb 9, 2010
1 parent 33dfe2c commit 76645aa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README
Expand Up @@ -6,7 +6,7 @@ This is a suite of template tags to assist in generating charts using Google's
for that. for that.


Currently the library is long on code, and short on testing and documentation. 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``. For example usage, see ``docs/examples.html``.


Expand Down
10 changes: 6 additions & 4 deletions googlecharts/templatetags/charts.py
@@ -1,6 +1,5 @@
import sys import sys
import inspect import inspect
import functools
import colorsys import colorsys


from django import template from django import template
Expand Down Expand Up @@ -892,9 +891,12 @@ def smart_join(sep, *args):


def urlencode(query, safe="/:,|"): def urlencode(query, safe="/:,|"):
'''Omit any options that begin with _; for internal use''' '''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 if hasattr(query, "items"):
qlist = ["%s=%s" % (q(k), q(v)) for (k,v) in query if not k.startswith('_')] 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) return "&".join(qlist)


def flatten(iterator): def flatten(iterator):
Expand Down

0 comments on commit 76645aa

Please sign in to comment.