Skip to content

Instantly share code, notes, and snippets.

@tell-k
Created September 14, 2012 11:12
Show Gist options
  • Save tell-k/3721355 to your computer and use it in GitHub Desktop.
Save tell-k/3721355 to your computer and use it in GitHub Desktop.
class Entry(Base):
__tablename__ = 'entries'
id = Column(Integer, primary_key=True)
text = Column(String(200))
created_at = Column(DateTime, default=datetime.now, nullable=False)
comments = relationship('Comment', backref="entry", lazy="select") #<= lazyパラメータ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment