forked from 0x2620/pandora
return defined
This commit is contained in:
parent
1f1683c5a5
commit
afaa9178cf
3 changed files with 4 additions and 2 deletions
|
@ -189,11 +189,11 @@ class Annotation(models.Model):
|
||||||
|
|
||||||
l = self.get_layer()
|
l = self.get_layer()
|
||||||
if l['type'] == 'place':
|
if l['type'] == 'place':
|
||||||
qs = self.places.filter(defined=True)
|
qs = self.places.all()
|
||||||
if qs.count() > 0:
|
if qs.count() > 0:
|
||||||
j['place'] = qs[0].json(user=user)
|
j['place'] = qs[0].json(user=user)
|
||||||
elif l['type'] == 'event':
|
elif l['type'] == 'event':
|
||||||
qs = self.events.filter(defined=True)
|
qs = self.events.all()
|
||||||
if qs.count() > 0:
|
if qs.count() > 0:
|
||||||
j['event'] = qs[0].json(user=user)
|
j['event'] = qs[0].json(user=user)
|
||||||
|
|
||||||
|
|
|
@ -141,6 +141,7 @@ class Event(models.Model):
|
||||||
def json(self, user=None):
|
def json(self, user=None):
|
||||||
j = {
|
j = {
|
||||||
'id': self.get_id(),
|
'id': self.get_id(),
|
||||||
|
'defined': self.defined,
|
||||||
'editable': self.editable(user)
|
'editable': self.editable(user)
|
||||||
}
|
}
|
||||||
if self.user:
|
if self.user:
|
||||||
|
|
|
@ -83,6 +83,7 @@ class Place(models.Model):
|
||||||
def json(self, keys=None, user=None):
|
def json(self, keys=None, user=None):
|
||||||
j = {
|
j = {
|
||||||
'id': self.get_id(),
|
'id': self.get_id(),
|
||||||
|
'defined': self.defined,
|
||||||
'editable': self.editable(user)
|
'editable': self.editable(user)
|
||||||
}
|
}
|
||||||
if self.user:
|
if self.user:
|
||||||
|
|
Loading…
Reference in a new issue