#25201: Allow use_for_related_fields via as_manager()
-------------------------------------+-------------------------------------
     Reporter:  litchfield           |                    Owner:
                                     |  andersonresende
         Type:  New feature          |                   Status:  closed
    Component:  Database layer       |                  Version:  1.8
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:  fixed
     Keywords:                       |             Triage Stage:  Accepted
  use_for_related_fields             |
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Loïc Bistuer <loic.bistuer@…>):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"ed0ff913c648b16c4471fc9a9441d1ee48cb5420" ed0ff91]:
 {{{
 #!CommitTicketReference repository=""
 revision="ed0ff913c648b16c4471fc9a9441d1ee48cb5420"
 Fixed #10506, #13793, #14891, #25201 -- Introduced new APIs to specify
 models' default and base managers.

 This deprecates use_for_related_fields.

 Old API:

 class CustomManager(models.Model):
     use_for_related_fields = True

 class Model(models.Model):
     custom_manager = CustomManager()

 New API:

 class Model(models.Model):
     custom_manager = CustomManager()

     class Meta:
         base_manager_name = 'custom_manager'

 Refs #20932, #25897.

 Thanks Carl Meyer for the guidance throughout this work.
 Thanks Tim Graham for writing the docs.
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/25201#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 [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/068.bf98b15060fa132466a7de8a5df14bb7%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to