title: Sphinx class attribute documentation
body: <p>I've been trying to document my <a href="http://mongoengine-odm.readthedocs.org/" rel="noreferrer" title="MongoEngine">MongoEngine</a> based application, but I'm having problems with documenting attributes on my Document classes.</p>
  <p>I have taken the correct syntax for doing so is the following:</p>
  <pre><code>class Asset(Document):
       #: This is the URI of the document
       uri = StringField()
  </code></pre>
  <p>I've tried every way of documenting these attributes that I've found and even added an attribute that isn't a MongoEngine field just to make sure this isn't the issue:</p>
  <pre><code>class Asset(Document):
      &quot;&quot;&quot;
      The representation of a file uploaded into the data store.
      &quot;&quot;&quot;
  
      #: This is a test attribute.
      foo = 'bar'
      &quot;&quot;&quot;baz?&quot;&quot;&quot;
  
      #: This is a URI.
      uri = StringField(required=True)
      &quot;&quot;&quot;This is a URI &quot;&quot;&quot;
  </code></pre>
  <p>I have tried out various combinations of directives in the corresponding <code>.rst</code> file. At the moment it looks like this:</p>
  <pre><code>.. currentmodule:: mymodule.asset
  .. autoclass:: Asset
  .. autoattribute:: Asset.foo
  .. autoattribute:: Asset.uri
  </code></pre>
  <p>The output isn't very satisfying: The <code>foo</code> attribute has no documentation displayed at all and the uri field has MongoEngine's &quot;A unicode string field.&quot; (the documentation of the <code>StringField</code> class) as documentation. Also the attribute documentation is not put &quot;under&quot; the class (as with automodule + :members: - which outputs all fields with their MongoEngine description)</p>
  <p>Do I miss a Sphinx Extension? Or am I screwing up the Syntax?</p>