Skip to content

Instantly share code, notes, and snippets.

@tell-k
Created September 14, 2012 11:18
Show Gist options
  • Save tell-k/3721373 to your computer and use it in GitHub Desktop.
Save tell-k/3721373 to your computer and use it in GitHub Desktop.
# relationship('Comment', lazy="select") (デフォルト)
# ------------------------------------------
# * 取得タイミング
# * プロパティにアクセスしたタイミング
#
# entry = Entry.query.filter_by(id=1).first()
# entry.comments # <- タイミングここ
#
# * 発行SQL
#
# 1. SELECT * FROM entries WHERE entries.id = 1 LIMIT 1
# 2. SELECT * FROM comments WHERE comments.entry_id =1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment