Skip to content

Instantly share code, notes, and snippets.

@inklesspen
Last active January 18, 2016 21:07
Show Gist options
  • Save inklesspen/1854dc831c138d6496a6 to your computer and use it in GitHub Desktop.
Save inklesspen/1854dc831c138d6496a6 to your computer and use it in GitHub Desktop.
# https://github.com/inklesspen/mimir/blob/fee47910e149094a339a26297324d61568dbadf3/mimir/models/mallows.py
class Writeup(Schema):
id = fields.Integer()
author_slug = fields.String()
writeup_slug = fields.String()
title = fields.String()
status = fields.String()
published = fields.Boolean()
offensive_content = fields.Boolean()
triggery_content = fields.Boolean()
posts = fields.Nested(
'WriteupPost',
only=['author', 'index', 'ordinal', 'title', 'published'],
many=True)
class WriteupPost(Schema):
id = fields.Integer()
writeup_id = fields.Integer()
author = fields.String()
index = fields.Integer()
ordinal = fields.String()
title = fields.String()
published = fields.Boolean()
writeup_title = fields.String(attribute='writeup.title')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment