#28107: Can't perform annotation on related table when un-managed model is 
backed
by a DB view
-------------------------------------+-------------------------------------
     Reporter:  powderflask          |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:  QuerySet.extra       |             Triage Stage:  Ready for
                                     |  checkin
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Jaap Roes):

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


Comment:

 This patch introduces a significant behavior change for all uses of
 unmanaged models (not only those that are backed by a database view) since
 Django 1.9. I believe the proper solution would be to just add the five
 lines of code that are posted in #comment:12 to the docs, somewhere near
 where it says that unmanaged models should be used for database views.

 For what it's worth, I reported #27241 and implemented the same
 workaround, so this patch is unnecessary in my case. As Simon said in the
 commit message, Django doesn't support database views. Being forced to
 include a small workaround to do the unsupported seems like a small price
 to pay.

--
Ticket URL: <https://code.djangoproject.com/ticket/28107#comment:18>
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/069.a422cf3df721f04ebdee3f5404404e19%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to