Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
ippidb-web
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
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
iPPIDB
ippidb-web
Commits
8e85d2bb
Commit
8e85d2bb
authored
4 years ago
by
Hervé MENAGER
Browse files
Options
Downloads
Patches
Plain Diff
correct sameAs syntax in compound cards
FIX #250
parent
174bc6cf
No related branches found
No related tags found
1 merge request
!24
prepare for v1.0.6
Pipeline
#43990
passed
4 years ago
Stage: test
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ippisite/ippidb/models.py
+15
-0
15 additions, 0 deletions
ippisite/ippidb/models.py
ippisite/ippidb/templates/compound_card.html
+2
-14
2 additions, 14 deletions
ippisite/ippidb/templates/compound_card.html
with
17 additions
and
14 deletions
ippisite/ippidb/models.py
+
15
−
0
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:
...
...
This diff is collapsed.
Click to expand it.
ippisite/ippidb/templates/compound_card.html
+
2
−
14
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
"
}
...
...
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