Open wadehehe opened 4 years ago
did you declare __tablename__
in your model class ? if not that should be the reason.
BTW, you should utilize db.ModelBase
for database models, it handles the tablename internally. check the source in instance/db.py
-> ModelBase
Yes I declare it. I think i have resolved it , ModelBase should inherit Sqlalchemy Model not Object.
sorry, i had to recheck my own reply, its in the git's readme file - you have to use instance.db.Base
as your model's base. that will do.
Thanks ,I also try with instance.db.Base ,but it also not working. I think _decl_class_registry is sqlalchemy attribute, so we must use it as ModelBase's base.
no no, you have to use db.Base
not the ModelBase
.
Best wishes - Asif Mahmud Shimon
On Thu, Mar 5, 2020 at 4:21 PM wadehehe notifications@github.com wrote:
Thanks ,I also try with instance.db.Base ,but it also not working. I think _decl_class_registry is sqlalchemy attribute, so we must use it as ModelBase's base.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/asif-mahmud/eve_runner/issues/1?email_source=notifications&email_token=ABLQLUQMUNXT5SR3ALOXQN3RF54LPA5CNFSM4LBB4C5KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEN4UFSQ#issuecomment-595149514, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLQLUWWRK6ORU5WPF5VL2TRF54LPANCNFSM4LBB4C5A .
Base._decl_class_registry can not find a key 'tablename'
What reason cause this?
I have already inherit BaseModel