From 8254a7a7db483e3d252d7cc34f5d254e98cfa066 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Sat, 15 Oct 2005 00:54:42 +0000 Subject: [PATCH] Fixed #628 -- Django no longer overwrites model class docstrings if they're provided git-svn-id: http://code.djangoproject.com/svn/django/trunk@878 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/core/meta/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/django/core/meta/__init__.py b/django/core/meta/__init__.py index 0c6078705a..f934f9dd6c 100644 --- a/django/core/meta/__init__.py +++ b/django/core/meta/__init__.py @@ -563,7 +563,8 @@ class ModelBase(type): new_class = type.__new__(cls, name, bases, attrs) # Give the class a docstring -- its definition. - new_class.__doc__ = "%s.%s(%s)" % (opts.module_name, name, ", ".join([f.name for f in opts.fields])) + if new_class.__doc__ is None: + new_class.__doc__ = "%s.%s(%s)" % (opts.module_name, name, ", ".join([f.name for f in opts.fields])) # Create the standard, module-level API helper functions such # as get_object() and get_list().