When you are enlightened, write it down.
- UserMixin doesn't have a query function; this is because the
load_user()
function was not returning a user, rather an instance of the user class with only theid
populated.
UserMixin provides default implementations for the methods that Flask-Login expects user objects to have.
declarative_base()
is a factory function that constructs a base class for declarative class definitions (which is assigned to Base variable in your example). The one you created in user.py is associated with User model.
Construct a base class for declarative class definitions.
The new base class will be given a metaclass that produces appropriate Table objects and makes the appropriate mapper() calls based on the information provided declaratively in the class and any subclasses of the class.
A lot of examples for starting Flask have you use an interactive db session to start the database. But shouldn't this be something that is done programmatically?