Closed NicholasZXT closed 4 months ago
There are 2 different things here - the DB table name and the class name.
Having your own DB tablename is supported and works as documented here: https://flask-security-too.readthedocs.io/en/stable/api.html#flask_security.models.fsqla.FsModels
The way to specify your tablename using sqlalchemy is: tablename = "myrole"
You are correct that changing the class isn't currently supported.
When using
FsUserMixin
class fromflask_security/models/fsqla_v3.py
,the role model class must be named withRole
,otherwise it's not working. The reason is the source code snippet as follow:Due to the code, role model likes
class SecurityRole(db.Model, fsqla.FsRoleMixin)
will failed to run. It's a little problem, but I do struggle with it for a while. Maybe it's not bad to add some custom for users like me in the future release.