Changes between Initial Version and Version 1 of Ticket #25937


Ignore:
Timestamp:
Dec 14, 2015, 12:17:58 PM (8 years ago)
Author:
Simon Charette
Comment:

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.
     1Running 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.
    22
    33
     
    2121{{{
    2222# Failure
    23 Potato.annotate(time=DateTime('removed'), 'month', timezone.UTC()).values('time').annotate(c=Count('pk'))
     23Potato.objects.annotate(time=DateTime('removed', 'month', timezone.UTC())).values('time').annotate(c=Count('pk'))
    2424
    2525# Success
    26 Potato.filter(removed__isnull=False).annotate(time=DateTime('removed'), 'month', timezone.UTC()).values('time').annotate(c=Count('pk'))
     26Potato.objects.filter(removed__isnull=False).annotate(time=DateTime('removed', 'month', timezone.UTC())).values('time').annotate(c=Count('pk'))
    2727}}}
    2828
Back to Top