-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:scieloorg/core
- Loading branch information
Showing
20 changed files
with
352 additions
and
1,930 deletions.
There are no files selected for viewing
Empty file.
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
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
19 changes: 19 additions & 0 deletions
19
pid_provider/migrations/0002_pidproviderxml_origin_date.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,19 @@ | ||
# Generated by Django 4.1.10 on 2023-08-02 02:11 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("pid_provider", "0001_initial"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="pidproviderxml", | ||
name="origin_date", | ||
field=models.CharField( | ||
blank=True, max_length=10, null=True, verbose_name="Origin date" | ||
), | ||
), | ||
] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,16 @@ | ||
from pid_provider import tasks | ||
|
||
|
||
def run(username, collection_acron=None, pids=None): | ||
if not collection_acron and not pids: | ||
return tasks.harvest_pids.apply_async( | ||
kwargs={ | ||
"username": username, | ||
"stop": 100, | ||
} | ||
) | ||
|
||
if not pids: | ||
return tasks.harvest_pids.apply_async( | ||
kwargs={ | ||
"username": username, | ||
"collection_acron": collection_acron, | ||
"stop": 100, | ||
} | ||
) | ||
|
||
if "," in pids: | ||
items = [ | ||
{"collection_acron": collection_acron, "pid_v2": pid_v2} | ||
for pid_v2 in pids.split(",") | ||
] | ||
return tasks.provide_pid_for_am_xmls.apply_async( | ||
kwargs={ | ||
"username": username, | ||
"items": items, | ||
} | ||
) | ||
|
||
return tasks.provide_pid_for_am_xml.apply_async( | ||
def run( | ||
username, collection_acron, from_date=None, limit=None, stop=None, force_update=None | ||
): | ||
return tasks.harvest_pids.apply_async( | ||
kwargs={ | ||
"username": username, | ||
"collection_acron": collection_acron, | ||
"pid_v2": pids, | ||
"from_date": from_date or "1900-01-01", | ||
"limit": int(limit or 1000), | ||
"force_update": force_update or False, | ||
"stop": int(stop or 1000), | ||
} | ||
) |
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
Oops, something went wrong.