Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adiciona funcionalidade de coleta e registro de press releases obtidos do Blog perspectiva #430

Merged
merged 29 commits into from
May 10, 2024

Conversation

samuelveigarangel
Copy link
Collaborator

@samuelveigarangel samuelveigarangel commented Apr 2, 2024

O que esse PR faz?

Este Pull Request introduz a implementação inicial da API para gerenciamento de Press Releases, além de melhorias em WebSiteConfiguration e refatorações.

Onde a revisão poderia começar?

pelos commits

Como este poderia ser testado manualmente?

N/A

Algum cenário de contexto que queira dar?

N/A

Screenshots

N/A

Quais são tickets relevantes?

#423

Referências

N/A

@samuelveigarangel samuelveigarangel changed the title [wip] Issue 423 Desenvolvimento e Implementação para Gestão da API PressReleases Apr 3, 2024
core/models.py Outdated
@classmethod
def get(cls, url):
if not url:
raise PressReleaseInvalidURL(" PressRelease requires url paramenter")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parameter

core/tasks.py Outdated

@celery_app.task(bind=True)
def try_fetch_and_register_press_release(self, username=None, user_id=None):
for journal in Journal.objects.all():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@samuelveigarangel faça 1 tarefa para resolver 1 pressrelease, 1 tarefa para executar para 1 journal, 1 tarefa para executar para uma dada configuração, sempre deixar possibilidade de passar parâmetros. Na ausência deles, é fazer para todos. Sempre tem que ter um intervalo de data.

queryset = PressRelease.objects.all()


class PressReleaseViewSet(GenericIssueViewSet):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@samuelveigarangel eu acho que não era necessário, pois faremos um post para o site, não serão expostos os press release, pelo menos não vejo esta demanda

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

É que eu tinha feito antes de saber do Payload no upload. E acabei que optei por manter.

collection=collection,
purpose=website_kind,
)
for ws in website.endpoint.all().iterator():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@samuelveigarangel filtrar para executar somente para o endpoint de pressrelease. Que atualmente só há para pressrelease, mas poderia ter outros endpoints.

):
try:
SciELOModel = SCIELO_MODELS.get(model_name)
callable_publish = PUBLISH_FUNCTIONS.get(model_name)(SciELOModel, api_data)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@samuelveigarangel está faltando algo? como executar callable_publish() ? Precisa da variável callable_publish?

core/tasks.py Outdated
@@ -28,8 +29,15 @@


@celery_app.task(bind=True)
def try_fetch_and_register_press_release(self, username=None, user_id=None):
for journal in Journal.objects.all():
def try_fetch_and_register_press_release(self, journal_acronym=None, username=None, user_id=None):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@samuelveigarangel só vai conseguir obter e retornar os press releases relacionados com journal. No entanto, não é desejável obter e retornar registros relacionados e sem relação com journal?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Olhei no blog e nao conseguir achar os pressrelease sem esta associado algum periodico

@@ -304,7 +304,7 @@ def task_publish_model_inline(
collection=collection,
purpose=website_kind,
)
for ws in website.endpoint.all().iterator():
for ws in website.endpoint.all().filter(name="pressrelease"):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for ws in website.endpoint.filter(name="pressrelease") ?

@samuelveigarangel samuelveigarangel changed the title Desenvolvimento e Implementação para Gestão da API PressReleases Adiciona funcionalidade de coleta e registro de press releases obtidos do Blog perspectiva May 8, 2024
@robertatakenaka robertatakenaka merged commit e0ecad2 into scieloorg:main May 10, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants