2

私はいくつかの appengine モデルと autodoc を使用しています。ただし、属性を適用するためのドキュメントを取得する方法が見つかりません。私はNDBを使用しており、ドキュメントをSphinxで構築しています。

たとえば、次のモデルを使用します。

class Greeting(ndb.Model):
  """Models an individual Guestbook entry with content and date."""
  content = ndb.StringProperty()
  date = ndb.DateTimeProperty(auto_now_add=True)

コンテンツの結果のdocstringは次のとおりです

値が制限された長さのテキスト文字列であるインデックス付きプロパティ

私は次のアプローチを試しました:

  "The content"
  content = ndb.StringProperty()

  content = ndb.StringProperty()
  "The content"

  #: the content
  content = ndb.StringProperty()

  content = ndb.StringProperty()
  content.__doc__="The content"

  content = ndb.StringProperty(__doc__="the content")

  content = ndb.StringProperty(doc="the content")

それらのどれもエラーを出さず、機能しません-私は常に「インデックス付きプロパティ...」を取得します。__doc__ を明示的に設定しても効果がないことに驚いています。

自分のdocstringを使用する方法はありますか?

4

1 に答える 1

0

答えは、Sphinx が問題なく動作することです。再構築されていないドキュメント出力の間違ったコピーを見ていました。これらは両方とも機能します。

content = ndb.StringProperty()
"The content"

#: the content
content = ndb.StringProperty()
于 2013-07-07T02:26:41.013 に答える