Sphinx class attribute documentation

To get the members of a class into the documentation, use the :members: option:

.. autoclass:: Asset
   :members:

Without :members:, only the class docstring is inserted.

See also the autodoc_default_flags configuration option.


You can get the same result as above with autoattribute and without :members: (note the indentation):

.. autoclass:: Asset

   .. autoattribute:: foo
   .. autoattribute:: uri

I cannot reproduce the problem that the uri attribute gets documented using the docstring from StringField.

I'm using Sphinx 1.2.2.


It turns out this problem was caused, in addition to mzjn's answer by something else: I had to fully qualify the class I was ..autoclass::ing for it to work because the module I specified for ..currentmodule:: was importing used the from x import y syntax, i.e. the following syntax works:

.. currentmodule: mymodule.asset
.. autoclass: mymodule.asset.Asset
   :members:

Long story short: Check your imports!