clear cache on remove, do not overwrite query but just set default, within
This commit is contained in:
parent
2b4c70056d
commit
9eccc030a1
2 changed files with 12 additions and 5 deletions
|
@ -31,6 +31,9 @@ def parseCondition(condition, user):
|
|||
exclude = True
|
||||
else:
|
||||
exclude = False
|
||||
if op == '-':
|
||||
return parseCondition({'key': k, 'value': v[0], 'operator': '>='}, user) \
|
||||
& parseCondition({'key': k, 'value': v[1], 'operator': '<'}, user)
|
||||
if k == 'id':
|
||||
v = v.split('/')
|
||||
if len(v) == 2:
|
||||
|
@ -40,7 +43,7 @@ def parseCondition(condition, user):
|
|||
return q
|
||||
if isinstance(v, bool): #featured and public flag
|
||||
key = k
|
||||
elif key in ('lat', 'lng', 'area', 'south', 'west', 'north', 'east', 'matches'):
|
||||
elif k in ('lat', 'lng', 'area', 'south', 'west', 'north', 'east', 'matches'):
|
||||
if op == '>':
|
||||
key = '%s__gt'%k
|
||||
elif op == '>=':
|
||||
|
@ -49,7 +52,8 @@ def parseCondition(condition, user):
|
|||
key = '%s__lt'%k
|
||||
elif op == '<=':
|
||||
key = '%s__lte'%k
|
||||
#default is exact match
|
||||
else: #default is exact match
|
||||
key = k
|
||||
else:
|
||||
if op == '=':
|
||||
key = '%s__iexact'%k
|
||||
|
|
|
@ -16,9 +16,9 @@ pandora.ui.placesDialog = function() {
|
|||
content: app.$ui.placesElement = new Ox.ListMap({
|
||||
height: height - 48,
|
||||
places: function(data, callback) {
|
||||
return pandora.api.findPlaces($.extend(data, {
|
||||
return pandora.api.findPlaces($.extend({
|
||||
query: {conditions: [], operator: ''}
|
||||
}), callback);
|
||||
}, data), callback);
|
||||
},
|
||||
addPlace: function(data, callback) {
|
||||
Ox.print('ADDPLACE', data);
|
||||
|
@ -34,7 +34,10 @@ pandora.ui.placesDialog = function() {
|
|||
},
|
||||
removePlace: function(data, callback) {
|
||||
Ox.print('REMOVEPLACE', data);
|
||||
pandora.api.removePlace(data.id, callback);
|
||||
pandora.api.removePlace(data.place, function(result) {
|
||||
Ox.Request.clearCache(); // fixme: remove
|
||||
callback(result);
|
||||
});
|
||||
},
|
||||
width: width
|
||||
}),
|
||||
|
|
Loading…
Reference in a new issue