Tortoise-orm: Models derivation

Created on 26 Feb 2019  Â·  2Comments  Â·  Source: tortoise/tortoise-orm

Describe the bug
Derived model not derives parent model fields.

To Reproduce
example

Logs:

[2019-02-26 16:58:50,616] DEBUG [asyncio.__init__:53] Using selector: EpollSelector
[2019-02-26 16:58:50,648] DEBUG [db_client.create_connection:64] Created connection <asyncpg.connection.Connection object at 0x7f5a6238b2d0> with params: user=postgres database=testdb host=localhost port=5432
[2019-02-26 16:58:50,649] DEBUG [db_client.execute_script:118] CREATE TABLE IF NOT EXISTS "something" ("name" TEXT NOT NULL, "id" SERIAL NOT NULL PRIMARY KEY);
[2019-02-26 16:58:50,667] DEBUG [db_client.close:76] Closed connection <asyncpg.connection.Connection object at 0x7f5a6238b2d0> with params: user=postgres database=testdb host=localhost port=5432

Expected behavior
Derived model includes all parent model fields (created, updated) as described here.

Additional context
Installed versions:

Python 3.7.2

tortoise-orm==0.11.4
asyncpg==0.18.3

PostgreSQL 11.2 (Debian 11.2-1.pgdg90+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, 64-bit
Future Release Waiting for feedback enhancement

Most helpful comment

Hi

Thank you for the detailed issue report :smile:
Tortoise doesn't currently support derived/subclassed models.

Will use this ticket as a feature request.

All 2 comments

Hi

Thank you for the detailed issue report :smile:
Tortoise doesn't currently support derived/subclassed models.

Will use this ticket as a feature request.

I guess this one is solved by version 0.12.4. Please give it a try.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ozturkberkay picture ozturkberkay  Â·  4Comments

pjongy picture pjongy  Â·  4Comments

anindyamanna picture anindyamanna  Â·  6Comments

je111ena picture je111ena  Â·  7Comments

mheppner picture mheppner  Â·  4Comments