return defined

This commit is contained in:
j 2012-02-01 16:35:57 +00:00
parent 1f1683c5a5
commit afaa9178cf
3 changed files with 4 additions and 2 deletions

View file

@ -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)

View file

@ -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:

View file

@ -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: