anders
anders

Reputation: 835

django-piston generated documentation for several handlers

I'm having a problem regarding the automagic documentation generated in django-pyston. Right now I have this and works:

from piston.handler import BaseHandler
from piston.doc import generate_doc

class FirstHandler(BaseHandler): 
...

doc = generated_doc(FirstHandler)

And is working fine. The problem is when I add a SecondHandler, I don't know how I should add it to the doc variable.

Piston own documentation isn't that well, don't mentioning anything about several handlers. Seeing in the code itself (doc.py) seems to be that using documentation_view should propagate every handler automatically, but it doesn't (or I'm doing it wrong):

from piston.doc import documentation_view

...

urlpatterns = patterns('',
    (r'^/doc$', documentation_view),
...
)

Upvotes: 0

Views: 452

Answers (1)

dArignac
dArignac

Reputation: 1209

You don't have to have the line

doc = generated_doc(FirstHandler)

within the module containing the Handlers. It's just a smaple from the poor documentation. The documentation view fetches all handlers automatically and then generated the documentation. Remove the line and it should work.

Upvotes: 1

Related Questions