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
27a7dabf
Commit
27a7dabf
authored
Dec 08, 2020
by
Hervé MENAGER
Browse files
enable lablinks files generation
fix #266
parent
0e170745
Changes
4
Hide whitespace changes
Inline
Side-by-side
ippisite/ippidb/management/commands/create_labslink_files.py
0 → 100644
View file @
27a7dabf
# coding: utf-8
from
django.db.models
import
CharField
,
Value
as
V
from
django.db.models.functions
import
Concat
from
django.db.models
import
F
,
Q
,
Case
,
When
from
ippidb.models
import
RefCompoundBiblio
from
biodblinks.lablinks.command
import
LabsLinkCommand
class
Command
(
LabsLinkCommand
):
queryset
=
(
RefCompoundBiblio
.
objects
.
exclude
(
Q
(
bibliography__source
=
"PT"
))
.
annotate
(
resource_title
=
Concat
(
V
(
"iPPI-DB compound #"
),
F
(
"compound__id"
),
output_field
=
CharField
()
)
)
.
annotate
(
resource_url
=
Concat
(
V
(
"https://ippidb.pasteur.fr/compounds/"
),
F
(
"compound__id"
),
output_field
=
CharField
(),
)
)
.
annotate
(
doi
=
Case
(
When
(
Q
(
bibliography__source
=
"DO"
),
then
=
F
(
"bibliography__id_source"
)),
default
=
None
,
output_field
=
CharField
(),
)
)
.
annotate
(
record_id
=
Case
(
When
(
Q
(
bibliography__source
=
"PM"
),
then
=
F
(
"bibliography__id_source"
)),
default
=
None
,
output_field
=
CharField
(),
)
)
.
annotate
(
record_source
=
Case
(
When
(
Q
(
bibliography__source
=
"PM"
),
then
=
V
(
"MED"
)),
default
=
None
,
output_field
=
CharField
(),
)
)
)
ippisite/ippisite/settings.py
View file @
27a7dabf
...
...
@@ -58,6 +58,7 @@ INSTALLED_APPS = [
# "allauth.socialaccount.providers.github",
"allauth.socialaccount.providers.orcid"
,
"polymorphic"
,
"biodblinks"
,
]
MIDDLEWARE
=
[
...
...
@@ -191,3 +192,10 @@ GALAXY_COMPOUNDPROPERTIES_WORKFLOWID = None
CELERY_RESULT_BACKEND
=
"django-db"
GA_CODE
=
None
# Django BioDbLinks settings
LABLINKS_ID_PREFIX
=
"https://ippidb.pasteur.fr"
LABLINKS_PROVIDER_ID
=
"2079"
LABLINKS_RESOURCE_NAME
=
"iPPI-DB"
LABLINKS_RESOURCE_DESCRIPTION
=
"iPPI-DB : An interactive database of protein-protein interactions modulators"
LABLINKS_CONTACT_EMAIL
=
"ippidb@pasteur.fr"
\ No newline at end of file
ippisite/ippisite/settings.template.py
View file @
27a7dabf
...
...
@@ -169,3 +169,10 @@ CRISPY_TEMPLATE_PACK = "bootstrap4"
# celery setting.
CELERY_RESULT_BACKEND
=
'django-db'
# Django BioDbLinks settings
LABLINKS_ID_PREFIX
=
"https://ippidb.pasteur.fr"
LABLINKS_PROVIDER_ID
=
"2079"
LABLINKS_RESOURCE_NAME
=
"iPPI-DB"
LABLINKS_RESOURCE_DESCRIPTION
=
"iPPI-DB : An interactive database of protein-protein interactions modulators"
LABLINKS_CONTACT_EMAIL
=
"ippidb@pasteur.fr"
\ No newline at end of file
ippisite/requirements-core.txt
View file @
27a7dabf
...
...
@@ -30,3 +30,5 @@ django-crispy-forms
celery==4.4.7
django-polymorphic
boltons
# django-biodblinks App
git+https://gitlab.pasteur.fr/hub/django-biodblinks.git#egg=django-biodblinks==0.1
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