[Django] #18468: Define COMMENT in table / colomns

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

[Django] #18468: Define COMMENT in table / colomns

Django
#18468: Define COMMENT in table / colomns
----------------------------------------------+--------------------
     Reporter:  mrechte                       |      Owner:  nobody
         Type:  Uncategorized                 |     Status:  new
    Component:  Database layer (models, ORM)  |    Version:  1.4
     Severity:  Normal                        |   Keywords:
 Triage Stage:  Unreviewed                    |  Has patch:  0
Easy pickings:  0                             |      UI/UX:  0
----------------------------------------------+--------------------
 Hello,

 That would be nice if it was possible to include comment on table /
 columns at creation time with the syncdb manage.py option.

 There could be a new Model Meta option like:
    comment = 'This table is for storing blabla"
 And a new Field option like:
    comment = 'This field is for ...'

 Thanks a lot

--
Ticket URL: <https://code.djangoproject.com/ticket/18468>
Django <https://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 [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.

Reply | Threaded
Open this post in threaded view
|

Re: [Django] #18468: Define COMMENT in table / colomns

Django
#18468: Define COMMENT in table / colomns
-------------------------------------+-------------------------------------
     Reporter:  mrechte              |                    Owner:  nobody
         Type:  Uncategorized        |                   Status:  new
    Component:  Database layer       |                  Version:  1.4
  (models, ORM)                      |               Resolution:
     Severity:  Normal               |             Triage Stage:
     Keywords:                       |  Unreviewed
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by niwi):

 * cc: niwi@… (added)
 * needs_docs:   => 0
 * has_patch:  0 => 1
 * needs_tests:   => 0
 * needs_better_patch:   => 0


Comment:

 I've implemented initial implementatio for postgresql_psycopg2 backend:
 https://github.com/niwibe/django/compare/issue_18468

 Is only implemented the table comment sql.

 If accepted as a new feature, would be nice to make design decisions.
 Today I put the comment for table in class "Meta", another option is to
 use the first line of the model docstrings.

 For fields, is more simple, just add an optional parameter "comment" at
 the Field.

--
Ticket URL: <https://code.djangoproject.com/ticket/18468#comment:1>
Django <https://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 [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.

Reply | Threaded
Open this post in threaded view
|

Re: [Django] #18468: Define COMMENT in table / colomns

Django
In reply to this post by Django
#18468: Define COMMENT in table / colomns
-------------------------------------+-------------------------------------
     Reporter:  mrechte              |                    Owner:  nobody
         Type:  Uncategorized        |                   Status:  closed
    Component:  Database layer       |                  Version:  1.4
  (models, ORM)                      |               Resolution:  duplicate
     Severity:  Normal               |             Triage Stage:
     Keywords:                       |  Unreviewed
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by aaugustin):

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


Comment:

 This is a duplicate of #13867, which lingered in DDN for two years until I
 wontfix'd it.

 The only argument I've seen is "it'd be nice if...". But I'm against
 adding features to Django just because we can; there must be a use case.

 Could you start a thread on the mailing-list, as recommended in the
 [https://docs.djangoproject.com/en/dev/internals/contributing/bugs-and-
 features/#requesting-features contributing guide], to see if there is
 support for this idea?

 If there's a good explanation of why you need this, I can reconsider my
 decision.

--
Ticket URL: <https://code.djangoproject.com/ticket/18468#comment:2>
Django <https://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 [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.

Reply | Threaded
Open this post in threaded view
|

Re: [Django] #18468: Define COMMENT in table / colomns

Django
In reply to this post by Django
#18468: Define COMMENT in table / colomns
-------------------------------------+-------------------------------------
     Reporter:  mrechte              |                    Owner:  nobody
         Type:  Uncategorized        |                   Status:  closed
    Component:  Database layer       |                  Version:  1.4
  (models, ORM)                      |               Resolution:  duplicate
     Severity:  Normal               |             Triage Stage:
     Keywords:                       |  Unreviewed
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by niwi):

 I understand your opinion! In any case, I'll write an email to the list
 which I think is useful.
 Thanks!

--
Ticket URL: <https://code.djangoproject.com/ticket/18468#comment:3>
Django <https://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 [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.

Reply | Threaded
Open this post in threaded view
|

Re: [Django] #18468: Define COMMENT in table / colomns

Django
In reply to this post by Django
#18468: Define COMMENT in table / colomns
-------------------------------------+-------------------------------------
     Reporter:  mrechte              |                    Owner:  nobody
         Type:  Uncategorized        |                   Status:  closed
    Component:  Database layer       |                  Version:  1.4
  (models, ORM)                      |               Resolution:  duplicate
     Severity:  Normal               |             Triage Stage:
     Keywords:                       |  Unreviewed
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by mrechte):

 I assume that most databases have comment on fields / tables feature not
 just because it is nice. Accessing Django created tables from another tool
 (for instance pgAdmin) would just make the system more productive.
 Personally I never create SQL tables without proper comments in the
 database itself.

--
Ticket URL: <https://code.djangoproject.com/ticket/18468#comment:4>
Django <https://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 [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.


Reply | Threaded
Open this post in threaded view
|

Re: [Django] #18468: Define COMMENT in table / colomns

Django
In reply to this post by Django
#18468: Define COMMENT in table / colomns
-------------------------------------+-------------------------------------
     Reporter:  mrechte              |                    Owner:  nobody
         Type:  Uncategorized        |                   Status:  closed
    Component:  Database layer       |                  Version:  1.4
  (models, ORM)                      |               Resolution:  duplicate
     Severity:  Normal               |             Triage Stage:
     Keywords:                       |  Unreviewed
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by lukeplant):

 The reasons given on #13867 still stand — Django is not aiming to provide
 a wrapper for every SQL feature. For example, it also doesn't provide an
 easy way to create stored procedures, functions or views, but you can
 always execute the SQL manually to add these, or could add some additional
 Python code that executed the SQL — for example using a South migration —
 if you want to ensure it always happens.

 In addition, if the audience of these comments is people administering the
 database without reading the Python source code, it doesn't make sense for
 these comments to be taking up space in the Python code, which has its own
 way of adding comments (docstrings and comment lines), which are targeted
 at programmers not DB admins.

--
Ticket URL: <https://code.djangoproject.com/ticket/18468#comment:5>
Django <https://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 [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.


Reply | Threaded
Open this post in threaded view
|

Re: [Django] #18468: Define COMMENT in table / colomns

Django
In reply to this post by Django
#18468: Define COMMENT in table / colomns
-------------------------------------+-------------------------------------
     Reporter:  mrechte              |                    Owner:  nobody
         Type:  Uncategorized        |                   Status:  new
    Component:  Database layer       |                  Version:  1.4
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:
                                     |  Unreviewed
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by mrechte):

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


Comment:

 Now that migration is built in Django, which can be used to create and
 administer the database, I again request this feature to be added. Thanks.

--
Ticket URL: <https://code.djangoproject.com/ticket/18468#comment:6>
Django <https://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 unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/065.b6f422796e7c8b9338b7459f1008c300%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #18468: Add the ability to define comments in table / columns (was: Define COMMENT in table / colomns)

Django
In reply to this post by Django
#18468: Add the ability to define comments in table / columns
-------------------------------------+-------------------------------------
     Reporter:  mrechte              |                    Owner:  nobody
         Type:  New feature          |                   Status:  closed
    Component:  Database layer       |                  Version:  1.4
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:  duplicate
     Keywords:                       |             Triage Stage:
                                     |  Unreviewed
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by timgraham):

 * status:  new => closed
 * type:  Uncategorized => New feature
 * resolution:   => duplicate


Comment:

 The correct way to reopen a ticket closed as "wontfix" is to start a
 discussion on the DevelopersMailingList. If there is consensus there to
 add the feature, then we reopen the ticket.

--
Ticket URL: <https://code.djangoproject.com/ticket/18468#comment:7>
Django <https://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 unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/065.9747e1ac097f8561670a0a5a233572ab%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #18468: Add the ability to define comments in table / columns

Django
In reply to this post by Django
#18468: Add the ability to define comments in table / columns
-------------------------------------+-------------------------------------
     Reporter:  Marc Rechté          |                    Owner:  nobody
         Type:  New feature          |                   Status:  new
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Ivan Chernoff):

 * status:  closed => new
 * cc: Ivan Chernoff (added)
 * version:  1.4 => master
 * has_patch:  1 => 0
 * resolution:  duplicate =>
 * stage:  Unreviewed => Accepted


Comment:

 After discussion on mailing list, the feature is good and can be added.
 (https://groups.google.com/forum/?nomobile=true#!topic/django-
 developers/guVTzO3RhUs)
 I'll prepare patch for review.

--
Ticket URL: <https://code.djangoproject.com/ticket/18468#comment:8>
Django <https://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 unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/065.72e565d0b452b8616be5bc2c7e5db257%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #18468: Add the ability to define comments in table / columns

Django
In reply to this post by Django
#18468: Add the ability to define comments in table / columns
-------------------------------------+-------------------------------------
     Reporter:  Marc Rechté          |                    Owner:  nobody
         Type:  New feature          |                   Status:  new
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Tim Graham):

 I guess the model field option could be called `db_column_comment`. I
 closed #28407 (introspecting column comments) as a duplicate since that
 should be implemented as part of this.

--
Ticket URL: <https://code.djangoproject.com/ticket/18468#comment:9>
Django <https://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 unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/065.6e1b0ba7cfee126a170902d3abaf8fee%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #18468: Add the ability to define comments in table / columns

Django
In reply to this post by Django
#18468: Add the ability to define comments in table / columns
-------------------------------------+-------------------------------------
     Reporter:  Marc Rechté          |                    Owner:  nobody
         Type:  New feature          |                   Status:  new
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Ivan Chernoff):

 Replying to [comment:9 Tim Graham]:
 > I guess the model field option could be called `db_column_comment`. I
 closed #28407 (introspecting column comments) as a duplicate since that
 should be implemented as part of this.

 I think that we don't need new param, because `comment` for django admin
 may be useful to store in database. But I can't decide on implementation,
 can you give me an advice?
 Postgres and oracle have a syntax like `comment on {table}.{column}` for
 storing comments, so this needs to be done after table/column creation, so
 there are two ways:

 1. Add it to post migrate signal, as for content types. But I can
 implement it as a third-party lib
 2. Add this SQL after database creation in schema.py

 Which way is better?

--
Ticket URL: <https://code.djangoproject.com/ticket/18468#comment:10>
Django <https://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 unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/065.863158b8e61123925e7f36f56165d90e%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #18468: Add the ability to define comments in table / columns

Django
In reply to this post by Django
#18468: Add the ability to define comments in table / columns
-------------------------------------+-------------------------------------
     Reporter:  Marc Rechté          |                    Owner:  nobody
         Type:  New feature          |                   Status:  new
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Ivan Chernoff):

 Anyone?

--
Ticket URL: <https://code.djangoproject.com/ticket/18468#comment:11>
Django <https://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 unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/065.61729c960770dfd50107f051160a7395%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #18468: Add the ability to define comments in table / columns

Django
In reply to this post by Django
#18468: Add the ability to define comments in table / columns
-------------------------------------+-------------------------------------
     Reporter:  Marc Rechté          |                    Owner:  nobody
         Type:  New feature          |                   Status:  new
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Tim Graham):

 I'm not sure what you mean by "comment for django admin". There isn't an
 existing option with that name.

 As for the implementation, the second approach sounds better.

--
Ticket URL: <https://code.djangoproject.com/ticket/18468#comment:12>
Django <https://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 unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/065.e2247499242813d15891c6458a5d80c3%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.