Changes between Initial Version and Version 1 of Ticket #25937
- Timestamp:
- Dec 14, 2015, 12:17:58 PM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #25937 – Description
initial v1 1 Running query like `qs.annotate(time=DateTime('removed' ), 'month', timezone.UTC()).values('time').annotate(Count('pk'))` fails with `<repr(<gill.contrib.sales.models.TransactionRowQuerySet at 0x10cc99320>) failed: ValueError: Database returned an invalid value in QuerySet.datetimes(). Are time zone definitions for your database and pytz installed?>`. I noted the failure on MySQL and PostgreSQL, Django 1.8.X and 1.9.X. I did not try on other db backends or other Django versions.1 Running query like `qs.annotate(time=DateTime('removed', 'month', timezone.UTC())).values('time').annotate(Count('pk'))` fails with `<repr(<gill.contrib.sales.models.TransactionRowQuerySet at 0x10cc99320>) failed: ValueError: Database returned an invalid value in QuerySet.datetimes(). Are time zone definitions for your database and pytz installed?>`. I noted the failure on MySQL and PostgreSQL, Django 1.8.X and 1.9.X. I did not try on other db backends or other Django versions. 2 2 3 3 … … 21 21 {{{ 22 22 # Failure 23 Potato. annotate(time=DateTime('removed'), 'month', timezone.UTC()).values('time').annotate(c=Count('pk'))23 Potato.objects.annotate(time=DateTime('removed', 'month', timezone.UTC())).values('time').annotate(c=Count('pk')) 24 24 25 25 # Success 26 Potato. filter(removed__isnull=False).annotate(time=DateTime('removed'), 'month', timezone.UTC()).values('time').annotate(c=Count('pk'))26 Potato.objects.filter(removed__isnull=False).annotate(time=DateTime('removed', 'month', timezone.UTC())).values('time').annotate(c=Count('pk')) 27 27 }}} 28 28