findPlace by id
This commit is contained in:
parent
e316d107a5
commit
8dcb5a8e31
1 changed files with 3 additions and 7 deletions
|
@ -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 == '>=':
|
||||||
|
|
Loading…
Reference in a new issue