#13867: Feature request: docstring and comments in Django models saved to
database
schema
------------------------------------------+---------------------------------
Reporter: rjalves | Owner: nobody
Status: new | Milestone: 1.3
Component: Database layer (models, ORM) | Version: 1.2
Keywords: | Stage: Unreviewed
Has_patch: 0 |
------------------------------------------+---------------------------------
Currently there is no way to make comments in the schema via Django. The
only way is to alter the tables and add the comments manually in the
database.
This feature request presents one possible implementation.
For comments at the __table level__, use the first line of the Model
__docstring__, truncating it depending on backend limitations.[[BR]]
For comments at the __column level__, include a __comment attribute__ on
the Field declaration.
{{{
class Dummy(Model):
"""This comment goes into the schema.
This and the following won't
...
"""
dummy_name = CharField(max_length=20, comment="All dummies should have
names right?")
...
}}}
In addition, a specific syntax could be used in the docstring to prevent
undesired comments in already existing code to be transfered to the
database.
--
Ticket URL: <http://code.djangoproject.com/ticket/13867>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.