mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-08 07:45:32 +01:00
more bulk edit
This commit is contained in:
parent
8699b6931c
commit
5369e0be03
3 changed files with 65 additions and 11 deletions
|
|
@ -1,5 +1,4 @@
|
|||
from documents.models import Document
|
||||
|
||||
from documents.models import Document, Correspondent
|
||||
|
||||
methods_supported = [
|
||||
"set_correspondent"
|
||||
|
|
@ -36,4 +35,15 @@ def perform_bulk_edit(data):
|
|||
|
||||
|
||||
def set_correspondent(ids, args):
|
||||
print("WOW")
|
||||
if not len(args) == 1:
|
||||
raise ValueError()
|
||||
|
||||
if not args[0]:
|
||||
correspondent = None
|
||||
else:
|
||||
if not isinstance(args[0], int):
|
||||
raise ValueError()
|
||||
|
||||
correspondent = Correspondent.objects.get(args[0])
|
||||
|
||||
Document.objects.filter(id__in=ids).update(correspondent=correspondent)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue