[Tutor] Cannot understand object initiation

Chris “Kwpolska” Warrick kwpolska at gmail.com
Mon Oct 14 16:26:22 CEST 2013


On Mon, Oct 14, 2013 at 3:27 PM, Kush Goyal <kushgoyal.89 at gmail.com> wrote:
> Also, db is an sqlalchemy engine and db.Model is a class.
>
> db.Model is I think a sqlalchemy declarative base class which has all
> the needed methods and classes for database handling.
>
> So, did I get the above things right?

Not quite.  db.Model is basically a representation of a database
record.  Read this:
http://docs.sqlalchemy.org/en/rel_0_8/orm/tutorial.html

Note that the above document uses the name `Base` (declarative base)
to describe what Flask-SQLAlchemy calls `db.Model`.

-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense


More information about the Tutor mailing list