-def document_list(request, filters=None):
- chunks = Chunk.objects.order_by('book__title', 'book', 'number')
-
- chunks = slug_filter(chunks, request.GET.get('user', None), 'user', User, 'username')
- chunks = slug_filter(chunks, request.GET.get('stage', None), 'stage', Chunk.tag_model, 'slug')
-
- chunks_list = helpers.ChunksList(chunks)
-
- return direct_to_template(request, 'catalogue/document_list.html', extra_context={
- 'books': chunks_list,
- 'last_books': sorted(request.session.get("wiki_last_books", {}).items(),
- key=lambda x: x[1]['time'], reverse=True),
- 'stages': Chunk.tag_model.objects.all(),
- 'users': User.objects.annotate(count=Count('chunk')).order_by('-count', 'last_name', 'first_name'),
- })