#34183: Add a ChoicesMeta.max_length property returning the max_length when data
type supports len()
-------------------------------------+-------------------------------------
     Reporter:  Coumes Quentin       |                    Owner:  Coumes
                                     |  Quentin
         Type:  New feature          |                   Status:  closed
    Component:  Database layer       |                  Version:  4.1
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:  wontfix
     Keywords:  choices, enums       |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

 * status:  assigned => closed
 * resolution:   => wontfix
 * component:  Utilities => Database layer (models, ORM)


Comment:

 Thanks for this ticket, however this would be highly fragile and error
 prone. First of all, removing an option from choices doesn't guarantee
 that it will not used by existing rows, so such migrations will quite
 often crash, or worse, the database may truncate existing data and create
 values that don't match `choices` (some database automatically truncate
 data when precision is changed). Secondly, altering a precision is a
 locking DDL operation, so it can be really disruptive for users to perform
 it after each change in `choices`.

 You can start a discussion on DevelopersMailingList, if you don't agree.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/34183#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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070184ae8d68ab-bd01408f-90ba-40e2-944c-43035fa48691-000000%40eu-central-1.amazonses.com.

Reply via email to