I created a test app using a mysql backend and a Article model with
created and updated datetime fields.
created = 2010-10-15 09:13:02
updated = 2010-10-15 09:18:43
select created - updated from article_article
+-------------------+
| updated - created |
+-------------------+
| 541.000000 |
+-------------------+
It's using the YYYYMMDDHHMMSS format of the datetime fields:
20101015091843 - 20101015091302 = 541
The delta isn't constant either, here are two sets of times that are 5
minutes apart:
created=2010-10-15 09:00:00, updated=2010-10-15 09:05:00
mysql: select created - updated yiels 500
created=2010-10-15:09:59:00, updated=2010-10-15 10:04:00
mysql: select created - updated yields 4500
I haven't looked at the django mysql backend code, but based on this
that warning is fatal in your case because it's definitely not doing
what you want. And I don't see how you could write your query filter
in its current format so that it is postgres/mysql agnostic
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
No problem.
So if you don't mind, what does your query filter look like now using
the converted format?
By the way, in answer to your original question on this thread, there
already is a ticket to add F() + timedelta.
http://code.djangoproject.com/ticket/10154
doh! Just noticed that you already referenced ticket 10154 in your
original post.