Created
September 14, 2012 00:04
-
-
Save tell-k/3718799 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
# 異なる方法で同じレコードを取り出してみる | |
entry1 = Entry.query.filter_by(id=1).first() | |
entry1_another = Entry.query.filter_by(text="entrytext1").first() | |
# IdentityMapにより同じオブジェクトが返ってくる | |
if entry1 == entry1_another: | |
print "same object" | |
print "entry1 => %s" % (entry1) | |
print "entry1_another => %s" % (entry1_another) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment