Created
July 26, 2011 17:35
-
-
Save joelburget/1107301 to your computer and use it in GitHub Desktop.
Don't save empty UserData
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
class UserData(db.Model): | |
... | |
def put(self, **kwargs): | |
# Only store the UserData if there is something worth storing | |
if self.points > 0 or self.coaches != [] or self.student_lists != [] \ | |
or self.moderator: | |
super(UserData, self).put(**kwargs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment