This commit is contained in:
j 2011-06-20 18:14:38 +02:00
parent 6c21c02359
commit 2ed6a707f5
2 changed files with 6 additions and 5 deletions

View file

@ -20,7 +20,7 @@ def parseCondition(condition, user):
k = condition.get('key', 'name') k = condition.get('key', 'name')
k = { k = {
'user': 'user__username', 'user': 'user__username',
'place': 'places__name', 'place': 'places__id',
}.get(k, k) }.get(k, k)
if not k: if not k:
k = 'name' k = 'name'
@ -40,11 +40,12 @@ def parseCondition(condition, user):
return ~q return ~q
else: else:
return q return q
if k == 'id': if k in ('id', 'places__id'):
v = ox.from32(v) v = ox.from32(v)
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', 'id'): elif k in ('lat', 'lng', 'area', 'south', 'west', 'north', 'east', 'matches',
'id', 'places__id'):
if op == '>': if op == '>':
key = '%s__gt'%k key = '%s__gt'%k
elif op == '>=': elif op == '>=':

View file

@ -150,12 +150,12 @@ pandora.ui.list = function(view) { // fixme: remove view argument
width: window.innerWidth - pandora.user.ui.showSidebar * pandora.user.ui.sidebarSize - 2 - 144 - Ox.UI.SCROLLBAR_SIZE, width: window.innerWidth - pandora.user.ui.showSidebar * pandora.user.ui.sidebarSize - 2 - 144 - Ox.UI.SCROLLBAR_SIZE,
}).bindEvent({ }).bindEvent({
selectplace: function(event, place) { selectplace: function(event, place) {
if(place) { if(place && place.id[0] != '_') {
pandora.$ui.clips.options({ pandora.$ui.clips.options({
items: function(data, callback) { items: function(data, callback) {
return pandora.api.findAnnotations($.extend(data, { return pandora.api.findAnnotations($.extend(data, {
query: { query: {
conditions:[{key: 'place', value: place.name, operator:'='}] conditions:[{key: 'place', value: place.id, operator:'='}]
}, },
itemQuery: pandora.Query.toObject() itemQuery: pandora.Query.toObject()
}), callback); }), callback);