开发者

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 im开发者_高级运维port documentation_view

...

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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜