findPlace by id

This commit is contained in:
j 2011-05-30 14:20:49 +02:00
parent d66393ac0e
commit f908e4cedb

View file

@ -2,6 +2,7 @@
# vi:si:et:sw=4:sts=4:ts=4 # vi:si:et:sw=4:sts=4:ts=4
from django.db.models import Q, Manager from django.db.models import Q, Manager
from ox.django.query import QuerySet from ox.django.query import QuerySet
import ox
def parseCondition(condition, user): def parseCondition(condition, user):
''' '''
@ -39,15 +40,10 @@ def parseCondition(condition, user):
else: else:
return q return q
if k == 'id': if k == 'id':
v = v.split('/') v = ox.from32(v)
if len(v) == 2:
q = Q(user__username=v[0], name=v[1])
else:
q = Q(id__in=[])
return q
if isinstance(v, bool): #featured and public flag if isinstance(v, bool): #featured and public flag
key = k key = k
elif k in ('lat', 'lng', 'area', 'south', 'west', 'north', 'east', 'matches'): elif k in ('lat', 'lng', 'area', 'south', 'west', 'north', 'east', 'matches', 'id'):
if op == '>': if op == '>':
key = '%s__gt'%k key = '%s__gt'%k
elif op == '>=': elif op == '>=':