11 lines
273 B
Python
11 lines
273 B
Python
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)
|