You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
Is it possible to include path params in a router prefix? For example, I want to use some nested routers, but the parameter in prefix will be a query param:
fromninjaimportRoutermain_router=Router(prefix='items/{item_hashid}/')
secondary_router=Router()
@secondary_router.get('/secondaryitems/{secondary_hashid}')deffoo(request, item_hashid: str, secondary_hashid: str):
# item_hashid is treated as a query param here instead of a path param passmain_router.add('secondary', secondary_router)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
Is it possible to include path params in a router prefix? For example, I want to use some nested routers, but the parameter in prefix will be a query param:
Beta Was this translation helpful? Give feedback.
All reactions