table 'roles_users' is already defined for this MetaData instance

前端 未结 11 1085
执笔经年
执笔经年 2021-02-05 01:40

hello iam trying to get a currnet_user information in my views

and i include from users.models import *

then in my code return return current_user;

<         


        
11条回答
  •  甜味超标
    2021-02-05 02:17

    Try adding:

    __table_args__ = {'extend_existing': True}

    right below __tablename__

    Reference: https://docs.sqlalchemy.org/en/13/orm/extensions/declarative/table_config.html?highlight=table_args

提交回复
热议问题