Page 1 of 1

v4.1 - Index show all document_types including trashed

Posted: Fri Oct 22, 2021 10:04 am
by gope
Hi,

I need to build an index that show all files by document type, including the trashed ones.
(To build a control version master file)
Is that possible on version 4.1?

{% if "_edit" not in document.label %} {{ document.document_type }} {% endif %}

This shows all files except the ones I explicitly indicated ("_edit"), but I need to include the trashed ones.

Thanks.

Re: v4.1 - Index show all document_types including trashed

Posted: Wed Oct 27, 2021 1:54 am
by lanterieur
I am not familiar with indexes.

If all you need is to check trash status, in Django template, you can access the trash status of a document through: `{{ document.in_trash }}`.

I know nothing about indexes, I am not sure on what data/queryset they are called. If the aforementioned .in_trash property does not do the job for you, consider looking at the python source.

I have fiddled around with Mayan EDMS source code to create additional API endpoints.
I encourage you to clone Mayan EDMS series/4.1 locally, follow the development deploy instructions (with virtual python env) and start playing around with query sets.

I suspect that by default most documents querysets will exclude trashed documents.
You may duplicate the documents list view and query documents directly (pseudo code getModel('documents').objects.all()). If you look at the model structure, trashed documents have a boolean "in_trash" set to true.

I am only a Mayan EDMS user and a beginner at that. Hope this helps.

Re: v4.1 - Index show all document_types including trashed

Posted: Fri Oct 29, 2021 8:33 am
by gope
Thanks for trying. :)

I'll have to check the code. It's just hard to justify the time spent on this..