|
|
@ -11,7 +11,6 @@ from {{cookiecutter.app_name}}.database import ( |
|
|
|
Column, |
|
|
|
Column, |
|
|
|
BcryptType, |
|
|
|
BcryptType, |
|
|
|
) |
|
|
|
) |
|
|
|
from {{cookiecutter.app_name}}.extensions import bcrypt |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Role(CRUDMixin, db.Model): |
|
|
|
class Role(CRUDMixin, db.Model): |
|
|
@ -20,6 +19,9 @@ class Role(CRUDMixin, db.Model): |
|
|
|
user_id = ReferenceCol('users', nullable=True) |
|
|
|
user_id = ReferenceCol('users', nullable=True) |
|
|
|
user = relationship('User', backref='roles') |
|
|
|
user = relationship('User', backref='roles') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def __init__(self, name, **kwargs): |
|
|
|
|
|
|
|
db.Model.__init__(self, name=name, **kwargs) |
|
|
|
|
|
|
|
|
|
|
|
class User(UserMixin, CRUDMixin, db.Model): |
|
|
|
class User(UserMixin, CRUDMixin, db.Model): |
|
|
|
|
|
|
|
|
|
|
|
__tablename__ = 'users' |
|
|
|
__tablename__ = 'users' |
|
|
|