Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
iPPIDB
ippidb-web
Commits
8e85d2bb
Commit
8e85d2bb
authored
Dec 22, 2020
by
Hervé MENAGER
Browse files
correct sameAs syntax in compound cards
FIX #250
parent
174bc6cf
Pipeline
#43990
passed with stages
in 19 minutes and 37 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
ippisite/ippidb/models.py
View file @
8e85d2bb
...
...
@@ -1150,6 +1150,21 @@ class Compound(AutoFillableModel):
else
None
)
@
property
def
sameas_urls
(
self
):
urls
=
[]
if
self
.
pubchem_id
:
urls
.
append
(
self
.
pubchem_url
)
if
self
.
chembl_id
:
urls
.
append
(
self
.
chembl_url
)
if
self
.
chemspider_id
:
urls
.
append
(
self
.
chemspider_url
)
if
self
.
ligand_id
:
urls
.
append
(
self
.
pdbligand_url
)
if
self
.
drugbank_id
:
urls
.
append
(
self
.
drugbank_url
)
return
urls
def
clean
(
self
):
"""
Perform additional checks:
...
...
ippisite/ippidb/templates/compound_card.html
View file @
8e85d2bb
...
...
@@ -572,20 +572,8 @@
"
smiles
"
:
[
"
{{ compound.canonical_smile }}
"
],
{
%
if
compound
.
pubchem_id
%
}
"
sameAs
"
:
"
{{ compound.pubchem_url }}
"
,
{
%
endif
%
}
{
%
if
compound
.
chembl_id
%
}
"
sameAs
"
:
"
{{ compound.chembl_url }}
"
,
{
%
endif
%
}
{
%
if
compound
.
chemspider_id
%
}
"
sameAs
"
:
"
{{ compound.chemspider_url }}
"
,
{
%
endif
%
}
{
%
if
compound
.
ligand_id
%
}
"
sameAs
"
:
"
{{ compound.pdbligand_url }}
"
,
{
%
endif
%
}
{
%
if
compound
.
drugbank_id
%
}
"
sameAs
"
:
"
{{ compound.drugbank_url }}
"
,
{
%
if
compound
.
sameas_urls
%
}
"
sameAs
"
:
{{
compound
.
sameas_urls
|
safe
}},
{
%
endif
%
}
"
@context
"
:
"
http://schema.org
"
}
...
...
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