Re: [Django] #25258: ExpressionWrapper documentation should be expanded

2016-08-18 Thread Django
#25258: ExpressionWrapper documentation should be expanded
-+-
 Reporter:  tarkatronic  |Owner:  nobody
 Type:   |   Status:  closed
  Cleanup/optimization   |
Component:  Documentation|  Version:  1.8
 Severity:  Normal   |   Resolution:  duplicate
 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 timgraham):

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


Comment:

 It looks like formal support for `Q` objects in expressions will be added
 in #27021, so I'll close this as a duplicate.

--
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/069.15756d6b6bf4170d7d42b980a30d0118%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #25258: ExpressionWrapper documentation should be expanded

2015-08-10 Thread Django
#25258: ExpressionWrapper documentation should be expanded
--+
 Reporter:  tarkatronic   |Owner:  nobody
 Type:  Cleanup/optimization  |   Status:  new
Component:  Documentation |  Version:  1.8
 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
--+

Comment (by tarkatronic):

 I would actually be a fan of the first option as, if I'm not mistaken,
 that would produce the expected behavior from my original snippet. I can
 see how a Case/When could be made to work in this case, but it doesn't
 seem as natural. Of course, this is also the first time I'm even hearing
 of those being available in Django.

--
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/069.0559ad403a2f943c11397e18813b1156%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #25258: ExpressionWrapper documentation should be expanded

2015-08-10 Thread Django
#25258: ExpressionWrapper documentation should be expanded
--+
 Reporter:  tarkatronic   |Owner:  nobody
 Type:  Cleanup/optimization  |   Status:  new
Component:  Documentation |  Version:  1.8
 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
--+

Comment (by jarshwah):

 `Q()` objects aren't actually expressions, but they are made from similar
 base types, and support parts of the expression API by virtue of being
 required by `Case Expressions`
 https://docs.djangoproject.com/en/1.8/ref/models/conditional-expressions/.

 I've seen quite a few cases of people using `Q()` objects as expressions
 lately, when they really should be using Conditional Expressions instead.

 So, I agree that something here needs to be fixed or documented. But
 `ExpressionWrapper` really is only meant to be used to wrap existing
 expressions, so I'm not too keen on documenting ExpressionWrapper further
 at this point.

 I guess we could define the output_field of Q() objects as always
 returning a BooleanField but, again, they aren't exactly Expressions
 themselves although they are close.

 I think the better options here are:

 1) Make Q() objects actual expressions (by implementing the full
 expression API on them). Not sure if Q() expressions will always work as
 annotations though, conditional expressions had some extra work to do to
 be compliant cross database.

 2) Highlight that Conditional Expressions should be used in the
 documentation and error messages where Q() objects are mentioned. Erroring
 early on direct Q() usage in annotations and guiding the user to Case/When
 is what I imagine here.

 I'm open to further suggestions.

--
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/069.99fad353f71c07a79a8edb0632420398%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #25258: ExpressionWrapper documentation should be expanded

2015-08-10 Thread Django
#25258: ExpressionWrapper documentation should be expanded
--+
 Reporter:  tarkatronic   |Owner:  nobody
 Type:  Cleanup/optimization  |   Status:  new
Component:  Documentation |  Version:  1.8
 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 timgraham):

 * needs_better_patch:   => 0
 * needs_docs:   => 0
 * type:  Bug => Cleanup/optimization
 * needs_tests:   => 0
 * stage:  Unreviewed => Accepted


Comment:

 If you could provide a patch based on what you have learned that would be
 great.

--
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/069.a6da86129f89f355a89f38078f3c7943%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.