]> git.parisson.com Git - telemeta.git/commitdiff
fix postgres query
authorGuillaume Pellerin <yomguy@parisson.com>
Wed, 4 Dec 2013 16:09:57 +0000 (17:09 +0100)
committerGuillaume Pellerin <yomguy@parisson.com>
Wed, 4 Dec 2013 16:09:57 +0000 (17:09 +0100)
telemeta/models/query.py

index 7cebc99e5cd050195646f61f17b13b62a1375b61..4c5625f0f7dcba23cb88a40b59709f3bbbc17bd8 100644 (file)
@@ -157,7 +157,7 @@ class MediaItemQuerySet(CoreQuerySet):
         from telemeta.models import Location
         for f in args:
             if f == 'apparent_collector':
-                if not 'sqlite3' in engine and not 'postgresql_psycopg2':
+                if not 'sqlite3' in engine and not 'postgresql_psycopg2' in engine:
                     related.append('collection')
                     qs = qs.extra(select={f:
                         'IF(collector_from_collection, '
@@ -167,7 +167,7 @@ class MediaItemQuerySet(CoreQuerySet):
                             'media_items.collector)'})
             elif f == 'country_or_continent':
                 related.append('location')
-                if not 'sqlite3' in engine and not 'postgresql_psycopg2':
+                if not 'sqlite3' in engine and not 'postgresql_psycopg2' in engine:
                     qs = qs.extra(select={f:
                         'IF(locations.type = ' + str(Location.COUNTRY) + ' '
                         'OR locations.type = ' + str(Location.CONTINENT) + ','