# HG changeset patch
# User Peter Nixon <
list...@peternixon.net>
# Date 1274281992 -10800
# Node ID 8883ca08318270ea981ed5ac13537d2df8697802
# Parent 5b6d964917b5deb5af17fa8293f5f63038765b9c
The tagging app really should be upgraded, but that currently breaks other things, so for the time being, backport
http://code.google.com/p/django-tagging/source/detail?r=172 which is the fix for
http://code.google.com/p/django-tagging/issues/detail?id=233 This allows byteflow to work with Django 1.2
diff --git a/apps/tagging/managers.py b/apps/tagging/managers.py
--- a/apps/tagging/managers.py
+++ b/apps/tagging/managers.py
@@ -153,8 +153,19 @@
greater than or equal to ``min_count`` will be returned.
Passing a value for ``min_count`` implies ``counts=True``.
"""
- extra_joins = ' '.join(queryset.query.get_from_clause()[0][1:])
- where, params = queryset.query.where.as_sql()
+
+ if getattr(queryset.query, 'get_compiler', None):
+ # Django 1.2+
+ compiler = queryset.query.get_compiler(using='default')
+ extra_joins = ' '.join(compiler.get_from_clause()[0][1:])
+ where, params = queryset.query.where.as_sql(
+ compiler.quote_name_unless_alias, compiler.connection
+ )
+ else:
+ # Django pre-1.2
+ extra_joins = ' '.join(queryset.query.get_from_clause()[0][1:])
+ where, params = queryset.query.where.as_sql()
+
if where:
extra_criteria = 'AND %s' % where
else: