Skip to content

Instantly share code, notes, and snippets.

@ryan2clw
Created August 25, 2019 03:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryan2clw/9f9c68fc79342541f8ad085e05aedbe0 to your computer and use it in GitHub Desktop.
Save ryan2clw/9f9c68fc79342541f8ad085e05aedbe0 to your computer and use it in GitHub Desktop.
remove excess data
(Keep the rest of BallSerializer)
def to_representation(self, instance):
""" Get rid of excess data, makes it easier to consume on the client """
ret = super().to_representation(instance)
ret.pop('updated_at')
ret.pop('is_played')
return ret
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment