You're missing result in your queries because your timestamp DateTimeField
includes time information (otherwise it would be a DateField).

Cheers,
AT

-- Sent from my phone, please excuse any typos. --
On Jun 12, 2012 7:55 AM, "Simon Pickles" <sipick...@gmail.com> wrote:

>  Hi, if my model has a timestamp field,
>
> class Attempt(models.Model):
>     timestamp = models.DateTimeField('Timestamp')
>
> How would I query to get entries from today? I tried:
>
> result = Attempt.objects.filter(timestamp = date.today())
>
> but it always says DoesNotExist (I can see entry in table in other ways).
> I think my query is wrong.
>
> Thanks for any help
>
>
> Simon
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to