2

我偷偷怀疑斯芬克斯不喜欢我的翻译课。当我尝试执行自动方法时:

.. automethod:: translations.models.Translation.new

我收到这个警告:

/Users/dash/Projects/zamboni/zamboni/docs/topics/translations.rst:39: 
(WARNING/2) autodoc can't import/find method 
'translations.models.Translation.new', it reported error: "cannot import name
Translation", please check your spelling and sys.path

路径之类的都是正确的。我试过直接在 conf.py 中导入翻译,也有类似的问题。当我尝试类似的东西时,我仍然遇到问题:

from translations.models import Translation as t

它能够导入,但 Translation 中的导入最终导致 Sphinx 返回相同的错误。

有问题的文档在这里:

赞博尼文档

4

1 回答 1

0

查看 Zamboni 源代码,也许您应该这样做:

.. automethod:: apps.translations.models.Translation.new

?

于 2012-12-07T16:22:20.347 回答