Created
January 5, 2012 19:50
-
-
Save fission6/1566908 to your computer and use it in GitHub Desktop.
monkey patch django User to access Mongo Document
This file contains 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 document(self): | |
user_id = self.id | |
user_document = UserDocument.objects.get(user_fk=user_id) | |
return user_document | |
User.add_to_class("document", document) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment