[Django] #28407: add db column comments to models Field comment_note

11 views
Skip to first unread message

Django

unread,
Jul 18, 2017, 3:22:46 AM7/18/17
to django-...@googlegroups.com
#28407: add db column comments to models Field comment_note
-------------------------------------+-------------------------------------
Reporter: 007gzs | Owner: nobody
Type: New | Status: new
feature |
Component: Database | Version: 1.11
layer (models, ORM) |
Severity: Normal | Keywords: db comment
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
when use inspectdb make model from db.
the db column is created by dba, not developer .
so db column comments set to models Field is helpful for developer.
like
{{{
field = models.IntegerField(blank=True, null=True) #comments in db
}}}
[https://github.com/django/django/pull/8738]

--
Ticket URL: <https://code.djangoproject.com/ticket/28407>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jul 18, 2017, 3:24:26 AM7/18/17
to django-...@googlegroups.com
#28407: add db column comments to models Field comment_note
-------------------------------------+-------------------------------------
Reporter: 007gzs | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: 1.11
(models, ORM) |
Severity: Normal | Resolution:

Keywords: db comment | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by 007gzs:

Old description:

> when use inspectdb make model from db.
> the db column is created by dba, not developer .
> so db column comments set to models Field is helpful for developer.
> like
> {{{
> field = models.IntegerField(blank=True, null=True) #comments in db
> }}}
> [https://github.com/django/django/pull/8738]

New description:

when use inspectdb make model from db.
the db column is created by dba, not developer .
so db column comments set to models Field is helpful for developer.
like
{{{
field = models.IntegerField(blank=True, null=True) #comments in db
}}}

[https://github.com/django/django/pull/8770]

--

--
Ticket URL: <https://code.djangoproject.com/ticket/28407#comment:1>

Django

unread,
Jul 20, 2017, 1:29:38 PM7/20/17
to django-...@googlegroups.com
#28407: Allow inspectdb to introspect db column comments

-------------------------------------+-------------------------------------
Reporter: 007gzs | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: 1.11
(models, ORM) |
Severity: Normal | Resolution:
Keywords: db comment | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* has_patch: 0 => 1
* stage: Unreviewed => Accepted
* needs_tests: 0 => 1


Comment:

I think the comment should be prefixed with something like `Column
comment: `. Also tests are required.

--
Ticket URL: <https://code.djangoproject.com/ticket/28407#comment:2>

Django

unread,
Jul 24, 2017, 11:24:35 AM7/24/17
to django-...@googlegroups.com
#28407: Allow inspectdb to introspect db column comments
-------------------------------------+-------------------------------------
Reporter: 007gzs | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: 1.11
(models, ORM) |
Severity: Normal | Resolution:
Keywords: db comment | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by 007gzs):

sorry i donot know how can i add a db with comment in tests.

--
Ticket URL: <https://code.djangoproject.com/ticket/28407#comment:3>

Django

unread,
Jul 24, 2017, 4:23:50 PM7/24/17
to django-...@googlegroups.com
#28407: Allow inspectdb to introspect db column comments
-------------------------------------+-------------------------------------
Reporter: 007gzs | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: 1.11
(models, ORM) |
Severity: Normal | Resolution:
Keywords: db comment | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham):

I think it would involve something like adding a
`BaseDatabaseSchemaEditor.sql_create_column_comment` attribute with the
SQL for creating a column comment. Then the test can use that.

--
Ticket URL: <https://code.djangoproject.com/ticket/28407#comment:4>

Django

unread,
Mar 12, 2018, 2:13:04 PM3/12/18
to django-...@googlegroups.com
#28407: Allow inspectdb to introspect db column comments
-------------------------------------+-------------------------------------
Reporter: 007gzs | Owner: nobody
Type: New feature | Status: closed

Component: Database layer | Version: 1.11
(models, ORM) |
Severity: Normal | Resolution: duplicate
Keywords: db comment | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* status: new => closed
* resolution: => duplicate


Comment:

Adding column comments as a model field option is accepted in #18468.

--
Ticket URL: <https://code.djangoproject.com/ticket/28407#comment:5>

Reply all
Reply to author
Forward
0 new messages