我正在使用几个应用程序模型和自动文档。但是,我找不到任何方法来获取我的文档来应用属性。我正在使用NDB并使用狮身人面像构建文档。
例如,在模型中:
class Greeting(ndb.Model):
"""Models an individual Guestbook entry with content and date."""
content = ndb.StringProperty()
date = ndb.DateTimeProperty(auto_now_add=True)生成的内容文档字符串为
一个索引属性,其值为有限长度的文本字符串。
我尝试了以下方法:
"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吗?
发布于 2013-07-07 02:26:41
答案是狮身人面像运作得很好。我看错了没有重建的文档输出的副本。这两项工作:
content = ndb.StringProperty()
"The content"
#: the content
content = ndb.StringProperty()https://stackoverflow.com/questions/17506620
复制相似问题