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()
|
||||
if l['type'] == 'place':
|
||||
qs = self.places.filter(defined=True)
|
||||
qs = self.places.all()
|
||||
if qs.count() > 0:
|
||||
j['place'] = qs[0].json(user=user)
|
||||
elif l['type'] == 'event':
|
||||
qs = self.events.filter(defined=True)
|
||||
qs = self.events.all()
|
||||
if qs.count() > 0:
|
||||
j['event'] = qs[0].json(user=user)
|
||||
|
||||
|
|
|
@ -141,6 +141,7 @@ class Event(models.Model):
|
|||
def json(self, user=None):
|
||||
j = {
|
||||
'id': self.get_id(),
|
||||
'defined': self.defined,
|
||||
'editable': self.editable(user)
|
||||
}
|
||||
if self.user:
|
||||
|
|
|
@ -83,6 +83,7 @@ class Place(models.Model):
|
|||
def json(self, keys=None, user=None):
|
||||
j = {
|
||||
'id': self.get_id(),
|
||||
'defined': self.defined,
|
||||
'editable': self.editable(user)
|
||||
}
|
||||
if self.user:
|
||||
|
|
Loading…
Reference in a new issue