Create one to many relationship between Role model and User model(one role can be assigned to to many users).
User roles
User<->Role
Report a typo
Fill in the gaps with the relevant elements
#...
class Role(db.Model):
id = db.Column(db.Integer, primary_key = True)
name = db.Column(db.String(20), unique = True)
permissions = db.Column(db.Integer)
#...
class User(db.Model):
id = db.Column(db.Integer, primary_key = True)
username = db.Column(db.String(20), unique = True)
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.