#33075: '__date' returns None in MySQL while it returns date object in Sqlite3
-------------------------------+--------------------------------------
Reporter: muhanpixie | Owner: nobody
Type: Bug | Status: new
Component: Uncategorized | Version: 3.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Description changed by muhanpixie:
Old description:
> database: mysql 5.7
> django version: 3.2
> python version: 3.8.1
>
> {{{Model.objects.values('some_datetime_field__date',) }}} returns None in
> MYSQL
>
>
> {{{
> class Inbound(models.Model):
> effective_date = models.DateTimeField(null=False, blank=True)
> number = models.IntegerField()
> # other fields.
>
> daily_changes = Inbound.objects.all().values('effective_date__date')\
> .annotate(total_change=Sum('number')).
> Inbound.objects.values('effective_date__date')
> }}}
>
>
> just returns Nones in Mysql
New description:
database: mysql 5.7
django version: 3.2
python version: 3.8.1
{{{Model.objects.values('some_datetime_field__date',) }}} returns None in
MYSQL
{{{
class Inbound(models.Model):
effective_date = models.DateTimeField(null=False, blank=True)
number = models.IntegerField()
# other fields.
daily_changes = Inbound.objects.all().values('effective_date__date')\
.annotate(total_change=Sum('number')).
Inbound.objects.values('effective_date__date')
}}}
The code just returns Nones in Mysql. But it returns date object with
Sqlite
--
--
Ticket URL: <https://code.djangoproject.com/ticket/33075#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/068.4d821ded2b51b41ab093d26db19fead5%40djangoproject.com.