Created
April 8, 2013 17:01
-
-
Save ageron/5338455 to your computer and use it in GitHub Desktop.
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
>>> from mongoengine import * | |
>>> class FacebookUser(Document): | |
... meta = { "allow_inheritance": False } | |
... facebook_id = StringField(primary_key = True, max_length = 20) | |
... | |
>>> connect("test") | |
Connection('localhost', 27017) | |
>>> FacebookUser.objects.delete() | |
>>> FacebookUser.objects | |
[] | |
>>> FacebookUser.objects.get_or_create(facebook_id = "1234") | |
(<FacebookUser: FacebookUser object>, True) | |
>>> FacebookUser.objects | |
[] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment