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 "<console>", line 1, in <module>
out: File "/home/mimi/.virtualenvs/atmav2/local/lib/python2.7/site-packages/django/db/models/query.py", line 234, in __repr__
out: data = list(self[:REPR_OUTPUT_SIZE + 1])
out: File "/home/mimi/.virtualenvs/atmav2/local/lib/python2.7/site-packages/django/db/models/query.py", line 258, in __iter__
out: self._fetch_all()
out: File "/home/mimi/.virtualenvs/atmav2/local/lib/python2.7/site-packages/django/db/models/query.py", line 1074, in _fetch_all
out: self._result_cache = list(self.iterator())
out: File "/home/mimi/.virtualenvs/atmav2/local/lib/python2.7/site-packages/django/db/models/query.py", line 112, in __iter__
out: for row in compiler.results_iter():
out: File "/home/mimi/.virtualenvs/atmav2/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 808, in results_iter
out: row = self.apply_converters(row, converters)
out: File "/home/mimi/.virtualenvs/atmav2/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 792, in apply_converters
out: value = converter(value, expression, self.connection, self.query.context)
out: File "/home/mimi/.virtualenvs/atmav2/local/lib/python2.7/site-packages/django/db/models/expressions.py", line 283, in convert_value
out: return float(value)
out: TypeError: float() argument must be a string or a number
Thank you for your help.