Monday, May 31, 2010

Inconsistent database results between application and shell

I have a query that filters on four fields:

res = MyModel.objects.filter(name=self.name,
type=self.type,
last_update_time__gte=today,
last_update_time__lte=tomorrow)

If I enter the exact same query in the shell, I get the correct
results from the database. If I access my app through the browser and
let it run the query, I get zero results. The settings file is correct
so I'm assuming that both executions are using the same remote
database. I'm seeing no errors or exceptions. The data being used in
the query is valid and exactly the same for both executions. What am I
missing? This is driving me nuts - any help appreciated. Thanks

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment