PEP8
No improvement.
This commit is contained in:
parent
026fba867d
commit
0ed70eb0a7
|
@ -779,12 +779,18 @@ class CategoryUpdate(SuccessMessageMixin, UpdateView):
|
||||||
|
|
||||||
# Article - General
|
# Article - General
|
||||||
class ArticleList(ListView):
|
class ArticleList(ListView):
|
||||||
queryset = (Article.objects
|
queryset = (
|
||||||
|
Article.objects
|
||||||
.select_related('category')
|
.select_related('category')
|
||||||
.prefetch_related(Prefetch('inventories',
|
.prefetch_related(
|
||||||
|
Prefetch(
|
||||||
|
'inventories',
|
||||||
queryset=Inventory.objects.order_by('-at'),
|
queryset=Inventory.objects.order_by('-at'),
|
||||||
to_attr='inventory'))
|
to_attr='inventory',
|
||||||
.order_by('category', '-is_sold', 'name'))
|
)
|
||||||
|
)
|
||||||
|
.order_by('category__name', '-is_sold', 'name')
|
||||||
|
)
|
||||||
template_name = 'kfet/article.html'
|
template_name = 'kfet/article.html'
|
||||||
context_object_name = 'articles'
|
context_object_name = 'articles'
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue