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

View file

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

View file

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