﻿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
14183	Geodjango models broken with pydoc	dzwarg	dario	"It's not possible to generate docs with pydoc for geographic models.

Use this as pydoctest/geotest/models.py:
{{{
#!python
""""""
Models to test pydoc.

I'm writing some DocStrings to test pydoc and geodjango.
""""""

# 1) Test that pydoc creates good docs with this line:
from django.db import models

# 2) Test that pydoc creates bad docs with this line:
#from django.contrib.gis.db import models

# Create your models here.
class TestGeoModel(models.Model):
    """"""This is a geographic model.

    It is very complicated, thus the enormously long docstring.""""""
    name = models.CharField(max_length=50)
    area = models.IntegerField()
    lon = models.FloatField()
    lat = models.FloatField()
    # 2) Uncomment these lines to generate bad docs with gis models:
    #geom = models.PolygonField()
    #objects = models.GeoManager()

    class Meta:
        """"""A meta class helper for TestGeoModel.

        This meta class tells me how to pluralize the name of TestGeoModel.""""""
        verbose_name_plural = 'TestGeoModelles'

    def __unicode__(self):
        """"""Get a unicode representation of this object (it's just its name).""""""
        return self.name
}}}

Steps to reproduce:
 1. django-admin startproject pydoctest
 1. cd pydoctest
 1. django-admin startapp geotest
 1. edit settings.py -- use a spatial db, like spatialite, add geotest to INSTALLED_APPS
 1. cd ..
 1. export DJANGO_SETTINGS_MODULE=pydoctest.settings
 1. pydoc pydoctest.geotest.models
 1. Observe: Good docs!
{{{
Help on module pydoctest.geotest.models in pydoctest.geotest:

NAME
    pydoctest.geotest.models - Models to test pydoc.

FILE
    /tmp/pydoctest/geotest/models.py

DESCRIPTION
    I'm writing some DocStrings to test pydoc and geodjango.

CLASSES
    django.db.models.base.Model(__builtin__.object)
        TestGeoModel

    class TestGeoModel(django.db.models.base.Model)
     |  This is a geographic model.
     |
     |  It is very complicated, thus the enormously long docstring.
     |
     |  Method resolution order:
     |      TestGeoModel
     |      django.db.models.base.Model
     |      __builtin__.object
...etc
}}}
 1. In pydoctest/geotest/models.py, comment out line 8.
 1. In pydoctest/geotest/models.py, uncomment line 11, 23, 24.
 1. pydoc pydoctest.geotest.models
 1. Observe: Bad docs!
{{{
Help on module pydoctest.geotest.models in pydoctest.geotest:

NAME
    pydoctest.geotest.models - Models to test pydoc.

FILE
    /tmp/pydoctest/geotest/models.py

DESCRIPTION
    I'm writing some DocStrings to test pydoc and geodjango.

CLASSES
    django.db.models.base.Model(__builtin__.object)
        TestGeoModel

    TestGeoModel = <class 'pydoctest.geotest.models.TestGeoModel'>

(END)
}}}

Please advise."	Bug	closed	GIS	1.1	Normal	worksforme	pydoc		Accepted	0	0	0	0	0	0
