Sorry, not sure about that warning because I'm using a postgresql database.
On Fri, Oct 15, 2010 at 3:17 AM, Marc Aymerich <glicer...@gmail.com> wrote: > > > On Fri, Oct 15, 2010 at 3:39 AM, Alec Shaner <asha...@chumpland.org> wrote: >> >> You can't add a datetime to another datetime - you want to add a >> datetime.timedelta instance instead. Out of curiosity I just tested it >> on one of my models and it does work, e.g., >> >> MyModel.objects.filter(update_date__gt=F('entry_date')+timedelta(days=5)) > > > Hi Alec, thanks again for your answer :) > When you executes this filter on a shell you don't get a warning ? > This is what happens to me: >>>> >>>> order.objects.filter(cancel_date__isnull=False).filter(cancel_date__lt=F('register_date') >>>> + timedelta(days=3)) > Traceback (most recent call last): > File "<console>", line 1, in <module> > File "/usr/lib/python2.6/dist-packages/django/db/models/query.py", line > 67, in __repr__ > data = list(self[:REPR_OUTPUT_SIZE + 1]) > File "/usr/lib/python2.6/dist-packages/django/db/models/query.py", line > 82, in __len__ > self._result_cache.extend(list(self._iter)) > File "/usr/lib/python2.6/dist-packages/django/db/models/query.py", line > 268, in iterator > for row in compiler.results_iter(): > File "/usr/lib/python2.6/dist-packages/django/db/models/sql/compiler.py", > line 672, in results_iter > for rows in self.execute_sql(MULTI): > File "/usr/lib/python2.6/dist-packages/django/db/models/sql/compiler.py", > line 727, in execute_sql > cursor.execute(sql, params) > File "/usr/lib/python2.6/dist-packages/django/db/backends/util.py", line > 18, in execute > return self.cursor.execute(sql, params) > File "/usr/lib/python2.6/dist-packages/django/db/backends/mysql/base.py", > line 86, in execute > return self.cursor.execute(query, args) > File "/usr/lib/pymodules/python2.6/MySQLdb/cursors.py", line 168, in > execute > if not self._defer_warnings: self._warning_check() > File "/usr/lib/pymodules/python2.6/MySQLdb/cursors.py", line 82, in > _warning_check > warn(w[-1], self.Warning, 3) > Warning: Truncated incorrect DOUBLE value: '3 0:0:0' > It's only a warning, but I can't see the output queryset result, maybe it's > a ""fatal"" warning? you know why this is happening? > Thanks again!! > > -- > Marc > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-us...@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-us...@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.