#31357: Stale content types can cause exception in ContentType.get_for_models
--------------------------------------+------------------------------------
     Reporter:  Andy Chosak           |                    Owner:  nobody
         Type:  Bug                   |                   Status:  new
    Component:  contrib.contenttypes  |                  Version:  3.0
     Severity:  Normal                |               Resolution:
     Keywords:                        |             Triage Stage:  Accepted
    Has patch:  0                     |      Needs documentation:  0
  Needs tests:  0                     |  Patch needs improvement:  0
Easy pickings:  0                     |                    UI/UX:  0
--------------------------------------+------------------------------------
Changes (by Simon Charette):

 * stage:  Unreviewed => Accepted


Comment:

 The proper way of performing the query is likely to group models by
 `app_label` and filter by unions of `Q(app_label=app_label,
 model__in=app_models)` for each of them.

 That will likely allow the database to keep using the unique index on
 `(app_label, model)`.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/31357#comment:1>
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/064.6fa28825230f491780b04c21234a6ab6%40djangoproject.com.

Reply via email to