whythawk / full-stack-fastapi-postgresql

Full stack, modern web application generator. Using FastAPI, PostgreSQL as database, Nuxt3, Docker, automatic HTTPS and more.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Nested model list

podaga opened this issue · comments

commented

Hello and thanks again for this marvellous stack !

I am trying to integrate a nested model and return a list.

This works fine for a single object, but not lists.

For example, simply adding "owner: User" to schemas in a related table returns the appropriate owner with related schema.

But I get "value is not a valid list (type=type_error.list)" if I try something such as "itemsRelation: list[ItemsSchema]".

The response returns a list and works well individually, but perhaps not in the correct format.

I will send a pull request for items table and related tests once this is running.

Thank you.

commented

Sorted...with good sleep I found the issue in models.