Created
March 29, 2011 07:43
-
-
Save andymccurdy/891956 to your computer and use it in GitHub Desktop.
FU Django ORM
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
#good | |
Foo.objects.get(fk=45) | |
#not good | |
Foo.objects.get(fk_id=45) | |
#good | |
Foo.objects.create(fk_id=45) | |
#not good | |
Foo.objects.create(fk=45) | |
of course this makes get_or_create unusable when using IDs of objects |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment