* component: Core (Other) => Database layer (models, ORM)
--
Ticket URL: <https://code.djangoproject.com/ticket/7074#comment:19>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* owner: => anubhav9042
* status: new => assigned
Comment:
Working on this in my GSoC project.
--
Ticket URL: <https://code.djangoproject.com/ticket/7074#comment:20>
Comment (by anubhav9042):
Can someone help me in reproducing this now. Because `__gt, __gte` works
for both `DateTimeField` as well as `DateField`. If that's not the only
issue here, kindly point me to what I have been missing.
--
Ticket URL: <https://code.djangoproject.com/ticket/7074#comment:21>
Comment (by anubhav9042):
models.py
{{{
from django.db import models
class Test(models.Model):
name = models.CharField(max_length=40)
created = models.DateField()
created2 = models.DateTimeField()
}}}
shell:
{{{
In [1]: from t19508.models import *
In [2]: import datetime
In [3]: d = datetime.datetime.now()
In [4]: d2 = d.date()
In [5]: t=Test.objects.using('mysql').create(name='anubhav',
created=d.date(), created2=d)
In [6]: t=Test.objects.using('mysql').filter(created2__gte="2008-04-23
14:39:36.133203")
In [7]: t[0].created
Out[7]: datetime.date(2014, 7, 28)
In [8]: t[0].created2
Out[8]: datetime.datetime(2014, 7, 28, 23, 36, 13, tzinfo=<UTC>)
In [9]:
t=Test.objects.using('mysql').filter(name__search="anubhav").filter(created2__gte="2008-04-23
14:39:36.133203")
In [10]: t[0].created
Out[10]: datetime.date(2014, 7, 28)
In [11]: t[0].created2
Out[11]: datetime.datetime(2014, 7, 28, 23, 36, 13, tzinfo=<UTC>)
}}}
I think that the problem now doesn't exists.
--
Ticket URL: <https://code.djangoproject.com/ticket/7074#comment:22>
* status: assigned => closed
* cc: anubhav9042@… (added)
* resolution: => worksforme
--
Ticket URL: <https://code.djangoproject.com/ticket/7074#comment:23>