Add Role.__init__

master
Steven Loria 11 years ago
parent 5bfd073802
commit de741805c5
  1. 4
      {{cookiecutter.app_name}}/{{cookiecutter.app_name}}/user/models.py

@ -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'

Loading…
Cancel
Save