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