use sphinx autodoc directives on geodjango application
|Reported by:||yml||Owned by:||nobody|
|Has patch:||yes||Needs documentation:|
|Needs tests:||Patch needs improvement:|
I am trying to generate the API documentation of django-geotagging
. django-geotagging is a django application. I would like to add to
the existing documentation rst files some "automatically" generated API documentation.
In order to do this I have added a file called : api.rst which look
like this : http://dpaste.com/58306/
when I run the this command:
sphinx-build -a -b html . _build
I get this error message :
Exception occurred:[ 20%] api File "/usr/lib/python2.6/django/contrib/gis/db/models/proxy.py", line 27, in __get__ geom_value = obj.__dict__[self._field.attname] AttributeError: 'NoneType' object has no attribute '__dict__' The full traceback has been saved in /tmp/sphinx-err-k0o7j2.log, if you want to report the issue to the author.
Changing the line 27 from :
geom_value = obj.__dict__[self._field.attname]
try: geom_value = obj.__dict__[self._field.attname] except: geom_value = None
seems to fix this issue. After this modification I can use autodoc however I am not sure if this is not breaking something else or only hiding the problem.
ps : I have described this behavior on this post 
Change History (6)
comment:3 Changed 7 years ago by
|Component:||Uncategorized → GIS|
|Triage Stage:||Unreviewed → Accepted|