mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-29 11:26:25 -05:00
The Any Tag filter works on the Videos, Archives and Docs searches (#958)
The filter modal on these pages offered "Any Tag", but only the Files search sent it; the module searches had no `any_tag` field. Docs also matched any of the listed tag_names, while every other search requires all of them. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
a0f30a0a60
commit
2800112f3e
16 changed files with 189 additions and 30 deletions
|
|
@ -1,6 +1,8 @@
|
|||
import dataclasses
|
||||
from typing import Optional
|
||||
|
||||
from wrolpi.errors import ValidationError
|
||||
|
||||
|
||||
@dataclasses.dataclass
|
||||
class DocSearchRequest:
|
||||
|
|
@ -14,6 +16,11 @@ class DocSearchRequest:
|
|||
limit: int = 20
|
||||
offset: int = 0
|
||||
deep: bool = False # When True, search all text including document contents (d_text)
|
||||
any_tag: bool = False # When True, only Docs with at least one Tag.
|
||||
|
||||
def __post_init__(self):
|
||||
if self.any_tag and self.tag_names:
|
||||
raise ValidationError('Cannot use both tag_names and any_tag.')
|
||||
|
||||
|
||||
@dataclasses.dataclass
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue