We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stories published manager only takes into account the story's status and published_date. Not the publish time.
This solution works for me,
from django.db.models import Q now = datetime.now() current_date = now.date() current_time = now.time() return queryset.filter(Q(publish_date__lt=current_date)|Q( publish_date=current_date, publish_time__lte=current_time)).filter( status__exact=PUBLISHED_STATUS)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Stories published manager only takes into account the story's status and published_date. Not the publish time.
This solution works for me,
from django.db.models import Q
now = datetime.now()
current_date = now.date()
current_time = now.time()
return queryset.filter(Q(publish_date__lt=current_date)|Q(
publish_date=current_date, publish_time__lte=current_time)).filter(
status__exact=PUBLISHED_STATUS)
The text was updated successfully, but these errors were encountered: