Re: [Tutor] Cannot understand object initiation

2013-10-14 Thread Chris “Kwpolska” Warrick
On Mon, Oct 14, 2013 at 3:27 PM, Kush Goyal 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

Re: [Tutor] Cannot understand object initiation

2013-10-14 Thread ALAN GAULD
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

Re: [Tutor] Cannot understand object initiation

2013-10-14 Thread Kush Goyal
Hi, Thanks a lot Bob and Allan for the help. 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. >From what I understood from your answers: user = User.query.filter

Re: [Tutor] Cannot understand object initiation

2013-10-12 Thread bob gailer
On 10/12/2013 11:01 AM, Kush Goyal wrote: [[snip] "user = User.query.filter_by ( username = self.username.data ).first()" now this I do not understand. Can a object be create by using a method of a class instead of the class consturctor? I Without seeing the code you reference (User module) I

Re: [Tutor] Cannot understand object initiation

2013-10-12 Thread Alan Gauld
On 12/10/13 16:01, Kush Goyal wrote: Hi, I am learning web development by using flask framework. The below code is used to create a class LoginForm which inherits from the class Form. In the method 'validate' of class 'LoginForm' the variable 'user' is initialized by using: "user = User.query.

[Tutor] Cannot understand object initiation

2013-10-12 Thread Kush Goyal
Hi, I am learning web development by using flask framework. The below code is used to create a class LoginForm which inherits from the class Form. In the method 'validate' of class 'LoginForm' the variable 'user' is initialized by using: "user = User.query.filter_by ( username = self.username.da