문제

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?

도움이 되었습니까?

해결책

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

id_ = request.matchdict['id']
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top