funky annotation ids
This commit is contained in:
parent
d897cb13bd
commit
f228a4a5e5
3 changed files with 6 additions and 3 deletions
|
@ -40,7 +40,9 @@ def parseCondition(condition, user):
|
||||||
return ~q
|
return ~q
|
||||||
else:
|
else:
|
||||||
return q
|
return q
|
||||||
if k in ('id', 'places__id'):
|
if k == 'id':
|
||||||
|
v = ox.from32(v.split('/')[-1])
|
||||||
|
elif k in ('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
|
||||||
|
|
|
@ -101,7 +101,7 @@ class Annotation(models.Model):
|
||||||
return self.value
|
return self.value
|
||||||
|
|
||||||
def get_id(self):
|
def get_id(self):
|
||||||
return ox.to32(self.id)
|
return '%s/%s' % (self.item.itemId, ox.to32(self.id))
|
||||||
|
|
||||||
def json(self, layer=False, keys=None):
|
def json(self, layer=False, keys=None):
|
||||||
j = {
|
j = {
|
||||||
|
|
|
@ -166,7 +166,8 @@ def editAnnotation(request):
|
||||||
'''
|
'''
|
||||||
response = json_response({})
|
response = json_response({})
|
||||||
data = json.loads(request.POST['data'])
|
data = json.loads(request.POST['data'])
|
||||||
a = get_object_or_404_json(models.Annotation, pk=ox.from32(data['id']))
|
itemId, annotationId = data['id'].split('/')
|
||||||
|
a = get_object_or_404_json(models.Annotation, pk=ox.from32(annotationId))
|
||||||
if a.editable(request.user):
|
if a.editable(request.user):
|
||||||
a.value = data['value']
|
a.value = data['value']
|
||||||
a.start = data['in']
|
a.start = data['in']
|
||||||
|
|
Loading…
Reference in a new issue