#30844: Add after_db_init() hook method to model
-------------------------------------+-------------------------------------
     Reporter:  rsinger86            |                    Owner:  nobody
         Type:  New feature          |                   Status:  closed
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:  wontfix
     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 felixxm):

 * status:  new => closed
 * version:  2.2 => master
 * resolution:   => wontfix
 * easy:  1 => 0


Comment:

 `select_related()` is not related with `Model`'s initialization it's a
 `QuerySet` method, so I cannot imagine how you would like to connect them.
 As you pointed out there are many ways to solve your issues in the current
 Django (e.g. you can
 
[https://docs.djangoproject.com/en/2.2/topics/db/managers/#modifying-a-manager-s
 -initial-queryset add select_related() to the initial QuerySet] and use
 `@cached_property`, there is also
 [https://docs.djangoproject.com/en/2.2/ref/signals/#post-init post_init]
 signal). You can use one of
 [https://code.djangoproject.com/wiki/TicketClosingReasons/UseSupportChannels
 support channels] to describe your real use case and get help.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/30844#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 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/067.f6fc46b1c1167f84017cecc79660f1eb%40djangoproject.com.

Reply via email to