On 18/05/2019 17:21, Arup Rakshit wrote:
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
a...@zeit.io
Please check this https://www.youtube.com/watch?v=EiOglTERPEo out. If
that doesn't answer your question please ask again.
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
_______________________________________________
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor