I tried experimenting with classes and objects on python interpretor
>and learned that in python functions, classes, method, objects and
>modules all can be passed around and returned.That's correct, they are all 
>objects in Python


From what I understood from your answers:
>
>user = User.query.filter_by ( username = self.username.data ).first()
>
>returns a reference to an instance of class User. So user is an object
>of type User class.Not necessarily. first() can return any kind of object. It 
>just seems likely 
that in this case it will be a User. But it depends entirely on how the 
first() method of whatever object User.query.filter_by() is implemented.

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.
>
>Possibly but you'll need someone who knows SQLAlchemy better than 
me to answer definitively

Alan G.
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to