#36480: FieldError when referencing a nonexistent alias provides less 
information
than nonexistent annotation
-------------------------------------+-------------------------------------
     Reporter:  Jacob Walls          |                    Owner:
         Type:                       |  houston0222
  Cleanup/optimization               |                   Status:  assigned
    Component:  Database layer       |                  Version:  dev
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:  typo                 |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Comment (by Jacob Walls):

 > I've tested the solution and it also lists for aggregate() which
 wouldn't be a valid choice

 I think it would still be worth including the aliases among the choices
 for an `aggregate()` call, so that you have the opportunity to fix a typo
 and receive the more informative:

 {{{#!py
 FieldError: Cannot aggregate over the 'my_alias' alias. Use annotate() to
 promote it.
 }}}

 Also, I wonder if in the future we will add support for `alias()` +
 `aggregate()`--the same logic holds that that querysets might be built
 incrementally, without knowledge of whether an aggregation will be
 attempted later--and if that scenario is possible then we might want to
 avoid adding complicated logic for the field error list.
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36480#comment:3>
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/01070197ac1f45ba-7b1c7af7-c2d8-418d-bd25-c3f19af2bb21-000000%40eu-central-1.amazonses.com.

Reply via email to