summaryrefslogtreecommitdiffstats
path: root/askbot/shims
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2011-12-10 16:17:34 -0300
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2011-12-10 16:17:34 -0300
commit6db4407af3ed35891afc0c548bdcd1d27bf460fd (patch)
tree628d7f9f23c468c54584dd092c2757e55fef6871 /askbot/shims
parent3d89144ab906b6f2c9ab609a4193a3be0c716512 (diff)
downloadaskbot-6db4407af3ed35891afc0c548bdcd1d27bf460fd.tar.gz
askbot-6db4407af3ed35891afc0c548bdcd1d27bf460fd.tar.bz2
askbot-6db4407af3ed35891afc0c548bdcd1d27bf460fd.zip
made askbot work with Django 1.2 again
Diffstat (limited to 'askbot/shims')
-rw-r--r--askbot/shims/__init__.py0
-rw-r--r--askbot/shims/django_shims.py22
2 files changed, 22 insertions, 0 deletions
diff --git a/askbot/shims/__init__.py b/askbot/shims/__init__.py
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/askbot/shims/__init__.py
diff --git a/askbot/shims/django_shims.py b/askbot/shims/django_shims.py
new file mode 100644
index 00000000..0fe6a964
--- /dev/null
+++ b/askbot/shims/django_shims.py
@@ -0,0 +1,22 @@
+"""shims for django objects of different versions
+only functionality that is necessary is implemented"""
+import django
+
+class ResolverMatch(object):
+ """a shim for the ResolverMatch, implemented
+ since django 1.3
+ before the match result was a three-tuple
+ """
+ def __init__(self, resolver_match):
+ self.resolver_match = resolver_match
+
+ def _get_func(self):
+ """the getter function for the
+ ``func`` property
+ """
+ if django.VERSION[1] < 3:
+ return self.resolver_match[0]
+ else:
+ return self.resolver_match.func
+
+ func = property(_get_func)