1. Jesper Nøhr
  2. django-piston
Issue #156 resolved

resource_uri and get_resource_uri_template

jordanreiter
created an issue

The function {{{get_resource_uri_template}}} in {{{ docs.py }} calls {{{resource_uri}}} thusly:

{{{ resource_uri = self.handler.resource_uri() }}}

In {{{emitters.py}}} however, it is called like so:

{{{ url_id, fields = handler.resource_uri(data) }}}

Which means, as far as I can gather, that if you define your function as

{{{

!python

@staticmethod
def resource_uri():
    return ('person', [ 'id'])

}}}

Then you will get an error on returning a response. However, because resource_uri is designed to expect arguments, {{{ resource_uri = self.handler.resource_uri() }}} always breaks, and thus on the documentation page URL is always None.

Can someone please confirm whether this is true, or if I am simply doing something wrong?

Thanks