-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f6315d5
commit 2a4ea71
Showing
7 changed files
with
185 additions
and
16 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
src/eke.knowledge/src/eke/knowledge/management/commands/edrn_pub_months.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# encoding: utf-8 | ||
|
||
'''💁♀️ EDRN Knowledge Environment: add months to publications.''' | ||
|
||
|
||
from django.conf import settings | ||
from django.core.management.base import BaseCommand | ||
from eke.knowledge.models import Publication | ||
|
||
|
||
class Command(BaseCommand): | ||
help = 'Add months to publications' | ||
|
||
def fix_publications(self): | ||
pmids = Publication.objects.filter(month='').values_list('pubMedID', flat=True) | ||
breakpoint() | ||
|
||
def handle(self, *args, **options): | ||
self.stdout.write('Adding months to publications') | ||
|
||
old = getattr(settings, 'WAGTAILREDIRECTS_AUTO_CREATE', True) | ||
try: | ||
settings.WAGTAILREDIRECTS_AUTO_CREATE = False | ||
settings.WAGTAILSEARCH_BACKENDS['default']['AUTO_UPDATE'] = False | ||
self.fix_publications() | ||
finally: | ||
settings.WAGTAILREDIRECTS_AUTO_CREATE = old | ||
settings.WAGTAILSEARCH_BACKENDS['default']['AUTO_UPDATE'] = True | ||
self.stdout.write("Job's done!") |
20 changes: 20 additions & 0 deletions
20
src/eke.knowledge/src/eke/knowledge/migrations/0020_publication_pis.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Generated by Django 4.2.16 on 2024-11-08 17:28 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("ekeknowledge", "0019_remove_protocol_fieldofresearch_and_more"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="publication", | ||
name="pis", | ||
field=models.CharField( | ||
blank=True, help_text="EDRN PIs who wrote this", max_length=250 | ||
), | ||
), | ||
] |
20 changes: 20 additions & 0 deletions
20
src/eke.knowledge/src/eke/knowledge/migrations/0021_publication_month.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Generated by Django 4.2.16 on 2024-11-08 18:54 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("ekeknowledge", "0020_publication_pis"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="publication", | ||
name="month", | ||
field=models.CharField( | ||
blank=True, help_text="Month of publication", max_length=10 | ||
), | ||
), | ||
] |
20 changes: 20 additions & 0 deletions
20
src/eke.knowledge/src/eke/knowledge/migrations/0022_alter_publication_month.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Generated by Django 4.2.16 on 2024-11-08 20:35 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("ekeknowledge", "0021_publication_month"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="publication", | ||
name="month", | ||
field=models.CharField( | ||
blank=True, help_text="Month of publication", max_length=16 | ||
), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters