summaryrefslogtreecommitdiff
path: root/archivist/prefixes.py
diff options
context:
space:
mode:
Diffstat (limited to 'archivist/prefixes.py')
-rw-r--r--archivist/prefixes.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/archivist/prefixes.py b/archivist/prefixes.py
index c85d833..5e28207 100644
--- a/archivist/prefixes.py
+++ b/archivist/prefixes.py
@@ -19,6 +19,7 @@ def _create_prefixes():
FieldPseudoPrefix('direction', 'In- or outgoing', Document.direction)
FieldPseudoPrefix('date', 'Date of creation', Document.created)
FieldPseudoPrefix('mime', 'Mime Type', Document.mimetype)
+ ContainsFieldPseudoPrefix('name', 'Name/description of document', Document.name)
for part in ('day', 'month', 'year'):
FieldPartPseudoPrefix(part, part.capitalize() + ' of creation', Document.created, part)
@@ -61,6 +62,10 @@ class FieldPseudoPrefix(PseudoPrefix):
def as_query(self, value):
return self._field == value
+class ContainsFieldPseudoPrefix(FieldPseudoPrefix):
+ def as_query(self, value):
+ return self._field.contains(value)
+
class FieldPartPseudoPrefix(PseudoPrefix):
def __init__(self, name, description, field, part):
self._field = field