place/event annotations always need a place/event object. set formated date on annotations
This commit is contained in:
parent
765cd51367
commit
40ee2a0860
4 changed files with 15 additions and 6 deletions
|
|
@ -197,10 +197,14 @@ class Annotation(models.Model):
|
|||
qs = self.places.all()
|
||||
if qs.count() > 0:
|
||||
j['place'] = qs[0].json(user=user)
|
||||
else:
|
||||
j['place'] = {}
|
||||
elif l['type'] == 'event':
|
||||
qs = self.events.all()
|
||||
if qs.count() > 0:
|
||||
j['event'] = qs[0].json(user=user)
|
||||
else:
|
||||
j['event'] = {}
|
||||
|
||||
if layer or (keys and 'layer' in keys):
|
||||
j['layer'] = self.layer
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue