<s> from database import db <EOL> from flask . ext . security import UserMixin , RoleMixin , SQLAlchemyUserDatastore <EOL> roles_users = db . Table ( '<STR_LIT>' , <EOL> db . Column ( '<STR_LIT>' , db . Integer ( ) , db . ForeignKey ( '<STR_LIT>' ) ) , <EOL> db . Column ( '<STR_LIT>' , db . Integer ( ) , db . ForeignKey ( '<STR_LIT>' ) ) ) <EOL> class User ( db . Model , UserMixin ) : <EOL> id = db . Column ( db . Integer , primary_key = True ) <EOL> email = db . Column ( db . String ( <NUM_LIT:255> ) , unique = True ) <EOL> password = db . Column ( db . String ( <NUM_LIT:255> ) ) <EOL> active = db . Column ( db . Boolean ( ) ) <EOL> confirmed_at = db . Column ( db . DateTime ( ) ) <EOL> roles = db . relationship ( '<STR_LIT>' , secondary = roles_users , <EOL> backref = db . backref ( '<STR_LIT>' , lazy = '<STR_LIT>' ) ) <EOL> last_login_at = db . Column ( db . DateTime ( ) ) <EOL> current_login_at = db . Column ( db . DateTime ( ) ) <EOL> last_login_ip = db . Column ( db . String ( <NUM_LIT:255> ) ) <EOL> current_login_ip = db . Column ( db . String ( <NUM_LIT:255> ) ) <EOL> login_count = db . Column ( db . Integer ) <EOL> def __repr__ ( self ) : <EOL> return '<STR_LIT>' % self . email <EOL> class Role ( db . Model , RoleMixin ) : <EOL> id = db . Column ( db . Integer ( ) , primary_key = True ) <EOL> name = db . Column ( db . String ( <NUM_LIT> ) , unique = True ) <EOL> description = db . Column ( db . String ( <NUM_LIT:255> ) ) <EOL> user_datastore = SQLAlchemyUserDatastore ( db , User , Role ) <EOL> class SomeStuff ( db . Model ) : <EOL> __tablename__ = '<STR_LIT>' <EOL> id = db . Column ( db . Integer , primary_key = True ) <EOL> data1 = db . Column ( db . Integer ) <EOL> data2 = db . Column ( db . String ( <NUM_LIT:10> ) ) <EOL> user_id = db . Column ( db . Integer , db . ForeignKey ( '<STR_LIT>' ) , nullable = True ) <EOL> user = db . relationship ( User , lazy = '<STR_LIT>' , join_depth = <NUM_LIT:1> , viewonly = True ) </s>
