table 'roles_users' is already defined for this MetaData instance

前端 未结 11 977
执笔经年
执笔经年 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:05

    I had this error when I had created a new class by copy-pasting a previous class. It turned out I had forgotten to change the __tablename__, so I had two classes with the same __tablename__ property. This caused the error, and changing the property resolved it.

提交回复
热议问题