#36326: Add support for CompositePrimaryKey in QuerySet.raw()
-------------------------------------+-------------------------------------
     Reporter:  Adam Johnson         |                    Owner:  (none)
         Type:  New feature          |                   Status:  new
    Component:  Database layer       |                  Version:  dev
  (models, ORM)                      |
     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 Sarah Boyce):

 * cc: Csirmaz Bendegúz, Simon Charette (added)
 * stage:  Unreviewed => Accepted
 * type:  Bug => New feature

Comment:

 Thank you for the report!
 I've marked this as a new feature to add support but I can be persuaded to
 have this as a release blocking bug

 Replicated:
 {{{#!diff
 --- a/tests/composite_pk/tests.py
 +++ b/tests/composite_pk/tests.py
 @@ -158,6 +158,10 @@ class CompositePKTests(TestCase):
          users = User.objects.values_list("pk").order_by("pk")
          self.assertNotIn('AS "pk"', str(users.query))

 +    def test_raw(self):
 +        users = User.objects.raw("SELECT * FROM composite_pk_user")
 +        self.assertEqual(len(users), 1)
 +
      def test_only(self):
          users = User.objects.only("pk")
          self.assertSequenceEqual(users, (self.user,))
 }}}
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36326#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 visit 
https://groups.google.com/d/msgid/django-updates/0107019634351a4e-bc960709-db1b-4ab1-922a-9aeafa55c1b8-000000%40eu-central-1.amazonses.com.

Reply via email to