Pretty much the title, I'm trying to setup Tortoise-ORM model that will include Field corresponding to Postgresql Array column.
It seems like to do it properly I'd need to build from asyncpg (since it has full array support) up extending Tortoise Field. However I'm just starting with Tortoise and maybe there's some better/easier way forward/someone already did something similar.
You need to implement your own field type. Here is my implementation:
I don't have dynamic type field implementation, which is not so difficult to make from this.
In some cases you need to put more logic into
to_db_value
andto_python_value
casting. For instance, if you are usingUUID[]
.