pydoc problem

5 views
Skip to first unread message

dailer

unread,
Jun 27, 2007, 9:58:09 PM6/27/07
to Django users
I have a models.py module that I thought I would test pydoc on. So I
try.....


$ python manage.py shell
Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from mysite.models import *
>>> help(Merchant)
Help on class Merchant in module mysite.models:

Merchant = <class 'src.mysite.models.Merchant'>

but this isn't the doc string I have for this class at all and isn't
what you normally get from pydoc. I try a few more of the classes with
the same result. So I copy one of those classes to a new class in the
same module (just adding the number 2 to the name) and it works
perfectly for that class. Obviously something somewhere else is
different but what?

Malcolm Tredinnick

unread,
Jun 28, 2007, 12:31:20 AM6/28/07
to django...@googlegroups.com
On Wed, 2007-06-27 at 18:58 -0700, dailer wrote:
> I have a models.py module that I thought I would test pydoc on. So I
> try.....
>
>
> $ python manage.py shell
> Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit
> (Intel)] on win32
> Type "help", "copyright", "credits" or "license" for more information.
> (InteractiveConsole)
> >>> from mysite.models import *
> >>> help(Merchant)
> Help on class Merchant in module mysite.models:
>
> Merchant = <class 'src.mysite.models.Merchant'>

Looks like this is the default result for Model subclasses. Possibly
related to the way we create them (using a metaclass). Feel free to work
out a patch in django/db/models/base.py (in the ModelBase class,
probably) if you want to fix this. It would probably be useful.

Otherwise, might be worth opening a ticket in case somebody else is
looking for something to do.

> but this isn't the doc string I have for this class at all and isn't
> what you normally get from pydoc. I try a few more of the classes with
> the same result. So I copy one of those classes to a new class in the
> same module (just adding the number 2 to the name) and it works
> perfectly for that class. Obviously something somewhere else is
> different but what?

Given the complete lack of example code you've provided, we have no way
of telling.

Regards,
Malcolm

--
Despite the cost of living, have you noticed how popular it remains?
http://www.pointy-stick.com/blog/

James Bennett

unread,
Jun 28, 2007, 12:50:04 AM6/28/07
to django...@googlegroups.com
On 6/27/07, Malcolm Tredinnick <mal...@pointy-stick.com> wrote:
> Looks like this is the default result for Model subclasses. Possibly
> related to the way we create them (using a metaclass). Feel free to work
> out a patch in django/db/models/base.py (in the ModelBase class,
> probably) if you want to fix this. It would probably be useful.

I've seen it happen as well, always on model classes. I need to check
a newforms form and see if the same happens to them.

--
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."

dailer

unread,
Jun 28, 2007, 9:21:24 AM6/28/07
to Django users

On Jun 28, 12:31 am, Malcolm Tredinnick <malc...@pointy-stick.com>
wrote:


the only reason I didn't provide an example is that it seemed
pointless given that you can copy the exact text of a class and change
one character of the class name and that class works.

Reply all
Reply to author
Forward
0 new messages