Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Fachgruppenwebseite Metadaten
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
fginfo
Fachgruppenwebseite Metadaten
Commits
88ff440e
Verified
Commit
88ff440e
authored
2 years ago
by
Jake
Browse files
Options
Downloads
Patches
Plain Diff
replace 'page' keyword in dictionaries with the referenced page
parent
858d525a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
fgs/datatypes.py
+5
-1
5 additions, 1 deletion
fgs/datatypes.py
with
5 additions
and
1 deletion
fgs/datatypes.py
+
5
−
1
View file @
88ff440e
...
...
@@ -19,13 +19,17 @@ class DictConverter:
for
i
in
item
:
res
.
append
(
self
.
convert
(
i
,
lang
))
return
res
# Replace specific string keywords with their referenced objects
elif
isinstance
(
item
,
str
)
and
key
==
"
link
"
:
return
self
.
factories
[
'
link
'
].
get_by_raw
(
item
,
lang
)
elif
isinstance
(
item
,
str
)
and
key
==
"
tag
"
:
return
self
.
factories
[
'
tag
'
].
get
(
item
,
lang
)
elif
isinstance
(
item
,
str
)
and
key
==
"
file
"
:
return
self
.
factories
[
'
file
'
].
get
(
item
)
#elif isinstance(item, str) and key == "slug":
elif
isinstance
(
item
,
str
)
and
key
==
"
page
"
:
return
self
.
factories
[
'
page
'
].
get
(
item
,
lang
)
#elif isinstance(item, str) and key == "slug": # Doesn't work because 'slug' is used to override the slug of a page in its metadata.
# return self.factories['page'].get(item, lang)
else
:
return
item
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment