Hi Tazo,
I just submitted a patch that correctly resolves the `output_field` of `Avg`
over non-numeric fields.
If it gets merged you shouldn't have to worry about passing an explicit
`output_field=DurationField()` in Django 1.10.
Simon
Le lundi 4 avril 2016 09:46:53 UTC-4, Tazo Gil a écrit :
>
Without your help, I would not get the solution. Maybe the doc
(https://docs.djangoproject.com/en/1.9/ref/models/querysets/#avg) should be
more precise about this case.
Merci beaucoup
Le lundi 4 avril 2016 05:35:14 UTC+2, Simon Charette a écrit :
>
> Hi Tazo,
>
> The default `output_field` of t
Hi Tazo,
The default `output_field` of the `Avg` aggregate is a `FloatField`[1] hence
the error raised here. In the case of SQLite, `DurationField`s are stored as
large integers of microseconds[2] and the result returned by the database is
already a float making `float(value)` a no-op in `convert_
I forgot to precise the type of the field Chrono.temps:
temps = models.DurationField(null=True)
Le samedi 2 avril 2016 19:08:20 UTC+2, Tazo Gil a écrit :
>
> Hello,
>
> The following request works in my dev django project (sqlite) by not in
> production with postgres
>
> out: >>>
> Questionn
Hello,
The following request works in my dev django project (sqlite) by not in
production with postgres
out: >>>
Questionnaire.objects.filter(site_id=1).annotate(moyenne=Avg('chrono__temps')).values('title','moyenne')
The errors :
out: Traceback (most recent call last):
out: File "", li
5 matches
Mail list logo