我有课:
class Holiday(ActivitiesBaseClass):
"""Holiday is an activity that involves taking time off work"""
Hotel = models.CharField(max_length=255)
""" Name of hotel """
我可以通过键入以下内容来打印类文档字符串:
print(Holiday.__doc__)
输出为:
Holiday is an activity that involves taking time off work
我如何打印作为Class属性/元素的Hotel的文档字符串?
print(Holiday.Hotel.__doc__)
返回:
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
我也尝试了help()
函数,但无济于事。
Sphinx似乎能够提取类属性的文档字符串并将其包含在readthedocs中,所以我希望有办法