Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
osp
tools.ethertoff
Commits
b44cd332
Commit
b44cd332
authored
Nov 29, 2019
by
gijs
Browse files
Removing content from debug page
parent
f0cdddc5
Changes
1
Hide whitespace changes
Inline
Side-by-side
generator/index.py
View file @
b44cd332
...
...
@@ -64,31 +64,32 @@ def make_index (models):
collection
=
collectionFor
(
contentType
)
for
obj
in
collection
.
models
:
if
obj
.
source_path
:
buff
+=
'<li><a href="https://ethertoff.caveat.be/w/{link}">{label}</a> ({type})'
.
format
(
buff
+=
'<li><
strong><
a href="https://ethertoff.caveat.be/w/{link}">{label}</a>
</strong>
({type})'
.
format
(
label
=
str
(
obj
),
type
=
obj
.
contentType
,
link
=
obj
.
source_path
.
replace
(
'#'
,
'%23'
)
)
else
:
buff
+=
'<li>
{label}
({type})'
.
format
(
buff
+=
'<li>
<strong>{label}</strong>
({type})'
.
format
(
label
=
str
(
obj
),
type
=
obj
.
contentType
)
for
attr
in
dir
(
obj
):
# Attributes noted in the metafields list, plus content,
# the link property and the sourcepath
buff
+=
'<dt>{attr}</dt>'
.
format
(
attr
=
attr
)
if
hasattr
(
obj
,
attr
):
field
=
getattr
(
obj
,
attr
)
if
is_multi_link
(
field
)
or
is_reverse_multi_link
(
field
):
for
link
in
field
.
value
:
buff
+=
display_link
(
link
)
elif
is_link
(
field
)
or
is_reverse_link
(
field
):
buff
+=
display_link
(
field
.
value
)
if
attr
!=
'content'
:
# Attributes noted in the metafields list, plus content,
# the link property and the sourcepath
buff
+=
'<dt>{attr}</dt>'
.
format
(
attr
=
attr
)
if
hasattr
(
obj
,
attr
):
field
=
getattr
(
obj
,
attr
)
if
is_multi_link
(
field
)
or
is_reverse_multi_link
(
field
):
for
link
in
field
.
value
:
buff
+=
display_link
(
link
)
elif
is_link
(
field
)
or
is_reverse_link
(
field
):
buff
+=
display_link
(
field
.
value
)
else
:
buff
+=
display_field
(
field
)
else
:
buff
+=
display_field
(
field
)
else
:
buff
+=
display_empty
()
buff
+=
display_empty
()
# if attr in obj.metadata \
# and is_link(obj.metadata[attr]):
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment