﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
11353	use sphinx autodoc directives on geodjango application	yml	nobody	"I am trying to generate the API documentation of django-geotagging
[1]. 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]
}}}

to : 
{{{
        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 [2]
[1] https://code.launchpad.net/~yml/django-geotagging/geotags/+merges
[2]http://groups.google.com/group/sphinx-dev/browse_thread/thread/7f0e83b3a2775d4"		closed	GIS	1.0		worksforme			Accepted	1				0	0
