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