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
|
# Article - General
|
||||||
class ArticleList(ListView):
|
class ArticleList(ListView):
|
||||||
queryset = (Article.objects
|
queryset = (
|
||||||
.select_related('category')
|
Article.objects
|
||||||
.prefetch_related(Prefetch('inventories',
|
.select_related('category')
|
||||||
queryset=Inventory.objects.order_by('-at'),
|
.prefetch_related(
|
||||||
to_attr='inventory'))
|
Prefetch(
|
||||||
.order_by('category', '-is_sold', 'name'))
|
'inventories',
|
||||||
|
queryset=Inventory.objects.order_by('-at'),
|
||||||
|
to_attr='inventory',
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.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