Issue #660 resolved

AttributeError on TagField

Atamert Ölçgen
created an issue

I am using the following field on my model:



tags = TagField(_(u"tags")) }}}

When I try to document this class with the following markup:



.. autoclass:: bdecommerce.models.myklass.MyKlass :members: }}}

I get the following exception:



Traceback (most recent call last): File "/home/muhuk/code/project/lib/python2.6/site-packages/sphinx/ext/", line 334, in import_object obj = self.get_attr(obj, part) File "/home/muhuk/code/project/lib/python2.6/site-packages/sphinx/ext/", line 237, in get_attr return safe_getattr(obj, name, *defargs) File "/home/muhuk/code/project/lib/python2.6/site-packages/sphinx/util/", line 29, in safe_getattr raise AttributeError(name) AttributeError: tags }}}

My virtualenv is:

  • Django==1.3
  • Sphinx==1.0.7
  • django-tagging==0.3.1

How can I get autodoc to publish the docstring for this attribute (field)?

Comments (6)

  1. Anonymous

    I have solved my problem adding the following code to

    from import Command as SyncdbCommand
  2. Charl Botha

    I am seeing exactly the same behaviour and trackback, but with on Django 1.6.x.

    Atamert Ölçgen Your workaround (which I have not been able to divine the mechanism of, could you elaborate on what problem it fixed?) does not work on my setup, instead yielding this traceback:

    # Sphinx version: 1.2.2
    # Python version: 2.7.6
    # Docutils version: 0.11 release
    # Jinja2 version: 2.7.3
    # Loaded extensions:
    Traceback (most recent call last):
      File "/home/cpbotha/.virtualenvs/kmxng/local/lib/python2.7/site-packages/sphinx/", line 253, in main
        warningiserror, tags, verbosity, parallel)
      File "/home/cpbotha/.virtualenvs/kmxng/local/lib/python2.7/site-packages/sphinx/", line 107, in __init__
        confoverrides or {}, self.tags)
      File "/home/cpbotha/.virtualenvs/kmxng/local/lib/python2.7/site-packages/sphinx/", line 229, in __init__
        execfile_(filename, config)
      File "/home/cpbotha/.virtualenvs/kmxng/local/lib/python2.7/site-packages/sphinx/util/", line 105, in execfile_
        exec code in _globals
      File "", line 28, in <module>
      File "/home/cpbotha/.virtualenvs/kmxng/local/lib/python2.7/site-packages/django/core/management/", line 285, in execute
        output = self.handle(*args, **options)
      File "/home/cpbotha/.virtualenvs/kmxng/local/lib/python2.7/site-packages/django/core/management/", line 415, in handle
        return self.handle_noargs(**options)
      File "/home/cpbotha/.virtualenvs/kmxng/local/lib/python2.7/site-packages/django/core/management/commands/", line 56, in handle_noargs
        connection = connections[db]
      File "/home/cpbotha/.virtualenvs/kmxng/local/lib/python2.7/site-packages/django/db/", line 193, in __getitem__
        if hasattr(self._connections, alias):
    TypeError: hasattr(): attribute name must be string

    Any help would be greatly appreciated!

  3. Log in to comment