>
> Also, some random feature requests:
>    
>    - .values(‘stuff’, my_thing=Coalesce(‘thing’, ‘stuff’)) should work
>
>  I thought this was already tracked but I couldn't find an existing 
ticket. So I created it: https://code.djangoproject.com/ticket/25871
Feel free to leave comments there if you feel that's a good idea, and to 
discuss some API ideas (like how to preserve existing **kwargs in values()).

>
>    - there should be a provided Year and Month functions to extract 
>    years/months from date fields
>
> It's coming in 1.10 https://github.com/django/django/pull/5683, although 
you can already sort of use the private versions (which will be moved in 
1.10 so be 
careful) 
https://github.com/django/django/blob/6f229048ddd8c7347ff60dddfb9121e6021c7b2e/django/db/models/lookups.py#L511

As far as grouping semantics go, I'm open to discussion! If someone was to 
put forward a proposal that could work and wouldn't unnecessarily burden 
users that aren't intimately familiar with SQL, then that would likely be 
welcome. Anssi mentioned exposing the underlying grouping method/dict which 
may be a good idea, but we'd like to avoid messing around with internal 
state too much.

Personally, I don't find grouping to be too much of a problem. Django 
generates the correct grouping based on what you've limited the columns to 
in your `values()` clause. There are outliers which we can maybe defend 
against with docs. The most unintuitive thing is adding `Meta: ordering` 
columns to the group by list, but I think that changed recently, or was 
just added?

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/d95be9df-2285-4105-bd22-99ad7cc016e3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to