Sphinx autodoc error on django ImageField

I am trying to use sphinx to document the django application that I am writing. So far I have my code.rst program to look at models.py, and when I start make html, I get automatic documentation, however I get a warning:

WARNING: autodoc can't import/find attribute 'myapp.models.MyModel.image', it reported error: "image", please check your spelling and sys.path

Whole tracelog:

Traceback (most recent call last):
  File "C:\blah\lib\site-packages\sphinx\ext\autodoc.py", line 326, in import_object
    obj = self.get_attr(obj, part)
  File "C:\blah\lib\site-packages\sphinx\ext\autodoc.py", line 232, in get_attr
    return safe_getattr(obj, name, *defargs)
  File "C:\blah\lib\site-packages\sphinx\util\inspect.py", line 70, in safe_getattr
    raise AttributeError(name)
AttributeError: image

MyModel.image - an image field, simply on a model defined as:

#: image file location for ``MyModel``
image = models.ImageField(upload_to="images/")

If I changed the image to models.Charfield, for example, it works fine. Is there a reason why it ImageFieldcan cause sphinx problems?

my code.rst:

.. automodule:: dynamicbanners.models
   :members:
+4
source share
2 answers

, , Django, sphinx.ext.autodoc. , Django 1.6, , Sphinx 1.2 , - .

0

All Articles