-
Notifications
You must be signed in to change notification settings - Fork 9
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
Cria Métodos de Classe no Modelo Article #832
Conversation
article/models.py
Outdated
def get_or_create(cls, doi, pid_v2, fundings, user): | ||
def get( | ||
cls, | ||
doi, |
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 acho melhor remover o doi. Se é necessário recuperar artigos por DOI, melhor ter um método específico para isso.
article/models.py
Outdated
doi=None, | ||
fundings=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 remover doi e fundings. O método create deveria somente aceitar pid_v3
article/models.py
Outdated
doi=None, | ||
fundings=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 remover doi e fundings, deixar apenas pid_v3
article/sources/preprint.py
Outdated
@@ -28,11 +28,9 @@ def harvest_preprints(URL, user): | |||
identifier = get_doi(article_info["identifier"]) | |||
doi = get_or_create_doi(doi=identifier, user=user) | |||
|
|||
article = models.Article.get_or_create( | |||
article = models.Article.create( |
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.
No caso, seria:
article = models.Article.objects.create(...)
Os metodos de criação de Article exigem pid_v3
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 Realizar correção
… `models.Article.objects.create`
@@ -28,7 +28,7 @@ def harvest_preprints(URL, user): | |||
identifier = get_doi(article_info["identifier"]) | |||
doi = get_or_create_doi(doi=identifier, user=user) | |||
|
|||
article = models.Article.create( | |||
article = models.Article.objects.create( |
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 Os artigos provenientes do preprint podem vir a entrar em alguma coleção SciELO. Então, isso tem que ser tratado para não duplicar...
O que esse PR faz?
Cria Métodos de Classe no Modelo Article
Onde a revisão poderia começar?
pelos commits
Como este poderia ser testado manualmente?
make up
Algum cenário de contexto que queira dar?
N/A
Screenshots
N/A
Quais são tickets relevantes?
#820
Referências
N/A