biosustain / potion

Flask-Potion is a RESTful API framework for Flask and SQLAlchemy, Peewee or MongoEngine
http://potion.readthedocs.io
Other
488 stars 51 forks source link

Possibility to define sub-routes ? #119

Closed buxx closed 7 years ago

buxx commented 7 years ago

Hello,

I would like implement "Item" (based on models) route like:

/api/houses/128/rooms/42/surface

Where my view is automatically provided with the House 128 and Room 42 (where Room 42 is linked to House 128 in database, else 404). Flask Potion is able to manage route like this ? Or i need to write a new Route class - if it is possible - like flask_potion.routes.ItemRoute ?

Thank's, Bux.

lyschoening commented 7 years ago

Potion is designed so that it only has exactly one endpoint for each type of resource, independent from any relationships the resource may have; all resources are top-level resources.