Replies: 2 comments 5 replies
-
Beta Was this translation helpful? Give feedback.
-
@sinisaos Thanks for the example and sorry if i wasnt precise enough. Maybe i mixed together 2 thoughts/questions here. Your example makes great use of Picollo ORM and FastApi but does not use |
Beta Was this translation helpful? Give feedback.
-
Hi there, thanks for this cool project. Just exploring the possibilities and i love it ❤️
As far as i understand there is no concept of nested routes native to Piccolo API or am i wrong?
What i am trying to achieve is to create a piccolo API endpoint like:
/movie/{movie_id}/actor
and
/movie/{movie_id}/actor/{actor_id}
I am aware of the concept of nested fields in
__visible_fields
. i could do/movie/?__visible_fields=name,actor.name
but i could not get it to work for M2M relations. Also the concept is neat but does not feel very "REST" for my personal taste (which does not mean anything, no front :) )I tried to achieve by implementing a custom FastAPI endpoint. Lets have a look at small sample ShoppingList app (With the weird feature of having one item on multiple lists, but lets ignore logic here :) ):
this does work. Lets look at the endpoints:
We now have Item endpoint only nested in a certain list. But the huge caveat is, we lose all the neat Piccolo API extras.
Does anyone have an idea how to have nested paths and Piccolo API magic together?
Beta Was this translation helpful? Give feedback.
All reactions