Pregunta

For this route:

config.add_route('item_get', '/item/{id}', request_method='GET')

What is the easiest way to get the {id} part from a view that uses this route?

¿Fue útil?

Solución

A dictionary is added to the request, called request.matchdict:

id_ = request.matchdict['id']
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top