nicer indented json encoding now also in rest api

This commit is contained in:
Laura Klünder 2016-09-13 16:20:37 +02:00
parent 55fc17e872
commit 84bb9ad73a
10 changed files with 62 additions and 40 deletions

View file

@ -54,6 +54,12 @@ class Package(models.Model):
def package(self):
return self
@property
def bounds(self):
if self.bottom is None:
return None
return ((float(self.bottom), float(self.left)), (float(self.top), float(self.right)))
def tofile(self):
data = OrderedDict()
data['name'] = self.name