-
Notifications
You must be signed in to change notification settings - Fork 7
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
Conversation
- Inserido os metodos de classe de PresRelease
Adiciona o metodo Language.load
- Cria relacao inlinepanel com WebSiteConfigurationEndpoint - Adiciona funcionalidade para criar objetos no inline em WebSiteConfiguration.create_or_update
- Cria publish_pressrelease
core/models.py
Outdated
@classmethod | ||
def get(cls, url): | ||
if not url: | ||
raise PressReleaseInvalidURL(" PressRelease requires url paramenter") |
There was a problem hiding this comment.
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(): |
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
publication/tasks.py
Outdated
collection=collection, | ||
purpose=website_kind, | ||
) | ||
for ws in website.endpoint.all().iterator(): |
There was a problem hiding this comment.
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.
publication/tasks.py
Outdated
): | ||
try: | ||
SciELOModel = SCIELO_MODELS.get(model_name) | ||
callable_publish = PUBLISH_FUNCTIONS.get(model_name)(SciELOModel, api_data) |
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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"): |
There was a problem hiding this comment.
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")
?
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