Ticket #628: patch.diff

File patch.diff, 717 bytes (added by jkocherhans@…, 10 years ago)

this patch only writes a default docsting for a model class if you haven't defined one in your model

  • django/core/meta/__init__.py

     
    563563        new_class = type.__new__(cls, name, bases, attrs)
    564564
    565565        # Give the class a docstring -- its definition.
    566         new_class.__doc__ = "%s.%s(%s)" % (opts.module_name, name, ", ".join([f.name for f in opts.fields]))
     566        if new_class.__doc__ is None:
     567            new_class.__doc__ = "%s.%s(%s)" % (opts.module_name, name, ", ".join([f.name for f in opts.fields]))
    567568
    568569        # Create the standard, module-level API helper functions such
    569570        # as get_object() and get_list().
Back to Top