sciodog/blog/views/articles_list.py

11 lines
273 B
Python
Raw Normal View History

2025-02-17 17:50:22 +00:00
from django.views.generic import ListView
from blog.models import Article
class ArticleList(ListView):
preview = False
def get_queryset(self):
status = 1
if self.preview:
status = 0
return Article.objects.filter(status=status)