tortoise-orm icon indicating copy to clipboard operation
tortoise-orm copied to clipboard

Base class fields of Model are None

Open Holmes555 opened this issue 3 years ago • 1 comments

Describe the bug I've created models like in this tutorial https://tortoise-orm.readthedocs.io/en/latest/models.html#inheritance and trying retrieve object of child class (from example it's UserModel) but fields 'created_at' and 'modified_at' from TimestampMixin are None. But I can see in database fields are filled, so the problem is in retrieving fields for base Model.

To Reproduce https://tortoise-orm.readthedocs.io/en/latest/models.html#inheritance

Expected behavior I want to isolate some repetitive fields in separate Class not inherited from models.Model and be able to get them.

Additional context Python - 3.10.0 Tortoise ORM - 0.19.1

Holmes555 avatar May 30 '22 16:05 Holmes555

This issue took me all day to figure out. My program was working and then it didn't. Pinning version 0.19.0 fixes things for me.

tinducvo avatar Jun 13 '22 23:06 tinducvo

Pinning version 0.19.0 fixes things for me.

+

0.19.1 and 0.19.2 are broken in fields abstract inheritance

gh0st-work avatar Jan 04 '23 02:01 gh0st-work