[Django]-Django application seems to use old QuerySet results for new requests based on date.today() filtering

3👍

Your QuerySet object is not request-scoped in Tastypie; it persists across requests. Thus your date.today is only evaluated once (even if you pass the date.today function as an argument instead of its return value), and not per request like you expect. Check out this recipe from the Tastypie docs for a fix.

👤GregM

1👍

Try this as your queryset value:

queryset = Event.objects.filter(status='P').exclude(date_end__lt=date.today)

Leave a comment