#34388: Added support for direct usage of Choices classes on model fields
-------------------------------------+-------------------------------------
     Reporter:  T. Franzel           |                    Owner:  nobody
         Type:  New feature          |                   Status:  new
    Component:  Database layer       |                  Version:  dev
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

 * status:  closed => new
 * resolution:  wontfix =>
 * stage:  Unreviewed => Accepted


Comment:

 OK, so... if we're happy with loosening the signature, then I count +4
 (not including Tim opening it) for this change in `Field.__init__`:

 {{{
     if isinstance(choices, ChoicesMeta):
         self.choices = choices.choices
 }}}

 I'll reopen and accept on that basis.

 There's a separate question about storing the reference to the `Choices`
 class... — and whether that would be public or not... (Given that's not
 used by Django, I'd lean to a decorator approach in the library using it,
 as I indicated,  but …)

-- 
Ticket URL: <https://code.djangoproject.com/ticket/34388#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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070186cc9e7b91-e2a77eef-af1e-4b33-be84-ef1ac4a621a2-000000%40eu-central-1.amazonses.com.

Reply via email to