﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
26696	QuerySet.extra: group by weekday on a date field	László Károlyi	nobody	"Hey,

I'm coming from the [https://docs.djangoproject.com/en/1.9/ref/models/querysets/#extra Django doc], where you say that I should try to avoid using `QuerySet.extra` in the future, and report the thing I want to achieve here, so you could improve the ORM. Here's the thing:

I have a mysql table where there is a `date` field. I'd like to do a `DAYOFWEEK(date)` calculation on it, then `GROUP BY` its result, and then do some `MIN`/`MAX`/`AVG` calculation on another field in the table. The point is to get the minimum/maximum/average values for the days of the week.

Currently this does not seem possible with even using the extra parameter.

Or is it?

Tips welcomed, but I actually have given up on creating this query out of the ORM."	Cleanup/optimization	closed	Database layer (models, ORM)	1.9	Normal	invalid	day of week weekday		Unreviewed	0	0	0	0	0	0
