I am writing an Flask app following a book, where a piece of python concept I
am not getting how it works. Code is:
class Role(db.Model):
__tablename__ = 'roles'
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(64), unique=True)
default = db.Column(db.Boolean, default=False, index=True)
permissions = db.Column(db.Integer)
users = db.relationship('User', backref='role', lazy='dynamic')
def __init__(self, **kwargs):
super(Role, self).__init__(**kwargs)
if self.permissions is None:
self.permissions = 0
Here, why super(Role, self).__init__(**kwargs) is used instead of
super().__init__(**kwargs) ? What that Role and self argument is instructing
the super() ?
Thanks,
Arup Rakshit
[email protected]
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor