Last active
March 25, 2016 04:32
-
-
Save robert8138/39fc25c02186a7b5ba26 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@property | |
def serialize(self): | |
'''return as a json object so we can use it in RESTful API''' | |
return {'id': self.id, | |
'date': self.date.strftime("%Y-%m-%d"), | |
'duration': self.duration, | |
'event_type': self.event_type, | |
'event_name': self.event_name } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment