#24231: Regression in availability of `_meta.get_field()` before app registry is
fully populated
-------------------------------------+-------------------------------------
     Reporter:  carljm               |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  1.7
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by pirosb3):

 * cc: pirosb3 (added)


Comment:

 Hi carljm

 Thanks for flagging the issue.

 - Related to docs: You are right! there is nothing stating when this API
 is ready to use. I think a note should be added.
 - Related to adding another public API: I think that 99% of the developers
 will have the Apps registry warmed by the time they touch the interpreter,
 or by the time the server is running. Also, getting a field by name can be
 done with a simple list comprehension making it close to a one-liner. Do
 you think this is worth the trouble?

 We could maybe do the following:
 - Document better this potential error message, and provide a simple
 alternative snippet
 - Modify the AppRegistryError to point to the docs, saying there is an
 alternative.
 But happy to discuss otherwise!

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

Reply via email to