Issue #142 new

HandlerDocumentation doesn't handle namespaced URLs

Chris Adams
created an issue

As currently defined, {{{HandlerDocumentation.get_resource_uri_template}}} does a simple reverse without namespacing. If you have a site which uses the same name for multiple views this can be solved everywhere else using Django's namespaced reversing (e.g. {{{api:item-detail}}} vs. {{{site:item-detail}}}). This works for the actual Piston handlers but the automatic documentation will display "None" rather than correctly reversing the URL.

This could be fixed to use the same reversing logic but it might be preferable to correct the mismatch between HandlerDocumentation's needs and the basic resource_uri functionality by allowing handlers to define a property or method ({{{resource_uri_templates}}}?) which could return more than one value so it would be possible to have the documentation display multiple URLs templates (e.g. {{{ /api/user/}}} and {{{/api/user/:user_id/}}}) without further complicating the current {{{get_resource_uri_template}}} implementation.

Comments (0)

  1. Log in to comment