Commit 905e75d4 authored by Zach Perkins's avatar Zach Perkins
Browse files

Got rid of as_json methods

parent df973667
......@@ -34,6 +34,7 @@ class Point(Base):
super(Point, self).__init__(**kwargs)
def validate_data(self, _, data):
if data is None:
......@@ -51,18 +52,6 @@ class Point(Base):
return data
def as_json(self, children=True):
if children:
children = [child.as_json(children=False) for child in self.children]
return {
"lon": self.lon,
"attributes": self.attributes,
"children": children
class Category(Base):
......@@ -76,14 +65,6 @@ class Category(Base):
fields = relationship("Field")
def as_json(self):
return {
"icon": self.icon,
"attributes": {attr.slug: attr.as_json() for attr in self.fields}
class Field(Base):
......@@ -104,10 +85,3 @@ class Field(Base):
Verify that data is the correct type for this Field.
def as_json(self):
return {
"slug": self.slug,
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment