[BACKEND] uid_sanitized variable (#256)
This commit is contained in:
parent
4b6add06e1
commit
7d29b72010
2 changed files with 11 additions and 0 deletions
|
|
@ -40,6 +40,16 @@ class BaseEntryVariables:
|
||||||
"""
|
"""
|
||||||
return self.kwargs(UID)
|
return self.kwargs(UID)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def uid_sanitized(self: "BaseEntry") -> str:
|
||||||
|
"""
|
||||||
|
Returns
|
||||||
|
-------
|
||||||
|
str
|
||||||
|
The sanitized uid of the entry, which is safe to use for Unix and Windows file names.
|
||||||
|
"""
|
||||||
|
return sanitize_filename(self.uid)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def extractor(self: "BaseEntry") -> str:
|
def extractor(self: "BaseEntry") -> str:
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,7 @@ def mock_entry_to_dict(
|
||||||
):
|
):
|
||||||
return {
|
return {
|
||||||
"uid": uid,
|
"uid": uid,
|
||||||
|
"uid_sanitized": uid,
|
||||||
"title": "entry {title}",
|
"title": "entry {title}",
|
||||||
"title_sanitized": "entry {title}",
|
"title_sanitized": "entry {title}",
|
||||||
"ext": ext,
|
"ext": ext,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue