Commit 6395745c by Calen Pennington

Clean up serialization on some fields

parent 89ea88cd
......@@ -17,6 +17,9 @@ class DateTuple(ModelType):
return datetime.datetime(*value[0:6])
def to_json(self, value):
if value is None:
return None
return list(value.timetuple())
......
......@@ -139,7 +139,7 @@ class TextbookList(ModelType):
json_data = []
for val in values:
if isinstance(val, Textbook):
json_data.append((textbook.title, textbook.book_url))
json_data.append((val.title, val.book_url))
elif isinstance(val, tuple):
json_data.append(val)
else:
......
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