Commit 27a7dabf authored by Hervé  MENAGER's avatar Hervé MENAGER
Browse files

enable lablinks files generation

fix #266
parent 0e170745
# 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(),
)
)
)
......@@ -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
......@@ -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
......@@ -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
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment