#32548: Support passing conditional expressions to Q().
-------------------------------------+-------------------------------------
     Reporter:  jonathan-golorry     |                    Owner:  jonathan-
         Type:                       |  golorry
  Cleanup/optimization               |                   Status:  assigned
    Component:  Database layer       |                  Version:  dev
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:  Q objects,           |             Triage Stage:  Accepted
  deconstruct                        |
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  1                    |  Patch needs improvement:  1
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Ian Foote):

 I like the consistency and simplicity of the reworked {{{deconstruct}}}
 method. I think removing weird edge-cases in {{{Q}}} is a good thing.

 I think I would personally prefer a deconstruct api that always uses
 kwargs where possible, rather than args:

 {{{('django.db.models.Q', (), {'x': 1, 'y': 2})}}} looks nicer than
 {{{('django.db.models.Q', (('x', 1), ('y', 2)), {})}}} to me.

 I don't know how much harder this would be to implement though, and it's a
 machine facing interface, so human readability isn't the highest priority.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32548#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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/074.b73b4982df08b8287030adbf410740b4%40djangoproject.com.

Reply via email to