Refactor: split views.py into documents/views/ module

documents/views.py suffers the same problem as serialisers.py: a
single 5,395-line file covering every REST resource in the app.
Restructures it into a package, one module per domain area, matching
the same layout used for documents/serialisers/.

paperless/urls.py and paperless_mail/views.py are updated to import
from the new submodules. Test files that imported or mock.patch'd
documents.views or documents.serialisers symbols directly are updated
to point at the correct submodule for both splits. The mypy and
pyrefly baselines are updated to reference the new file paths, and a
stale comment in chat_qa.j2 pointing at the old location of
_get_llm_output_language is corrected.
This commit is contained in:
stumpylog
2026-09-24 12:23:06 -07:00
parent 10dbb77d47
commit 2104fd5078
37 changed files with 7699 additions and 7279 deletions
@@ -22,7 +22,7 @@ import pytest
from rest_framework import status
import documents.search._backend
from documents.views import _MAX_QUERY_LENGTH
from documents.views.base import _MAX_QUERY_LENGTH
if TYPE_CHECKING:
from rest_framework.test import APIClient