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

Creating model for Unpaywall #1

Merged
merged 15 commits into from
Jul 5, 2022

Conversation

Rossi-Luciano
Copy link
Collaborator

O que esse PR faz?

Adiciona dois modelos ao repositório, o primeiro modelo para dados de artigos (Scholarly Articles) e o segundo modelo para dados de colaboradores (Contributor)

Onde a revisão poderia começar?

Por commit

Como este poderia ser testado manualmente?

NA.

Algum cenário de contexto que queira dar?

NA.

Screenshots

NA.

Quais são tickets relevantes?

NA.

Referências

https://unpaywall.org/data-format

@Rossi-Luciano Rossi-Luciano marked this pull request as draft June 27, 2022 18:46
@Rossi-Luciano Rossi-Luciano marked this pull request as ready for review June 27, 2022 18:46
@Rossi-Luciano Rossi-Luciano marked this pull request as draft June 27, 2022 18:48
@Rossi-Luciano Rossi-Luciano marked this pull request as ready for review June 27, 2022 18:50
@gitnnolabs
Copy link
Collaborator

@Rossi-Luciano

Suspeito que essa pasta .idea não faz parte do PR correto?

@robertatakenaka robertatakenaka changed the title Creating model Creating model for Unpaywall Jun 27, 2022
@gitnnolabs
Copy link
Collaborator

@Rossi-Luciano @robertatakenaka

Não iremos criar um campo para armazenar o JSON?



class ScholarlyArticles(models.Model):
doi = models.CharField("DOI", max_length=255)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Todos os campos são realmente obrigatórios?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Os campos obrigatórios foram indicados.
Foi criado um novo campo para o armazenamento do arquivo JSON (utilizei models.JSONField, não sei se é o correto).
Não consegui retroceder a pasta .idea

Copy link
Collaborator

Choose a reason for hiding this comment

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

@Rossi-Luciano quando eu for aprovar irei remover, vou colocar na lista de pastas para ser ignorada!

Copy link
Collaborator

@gitnnolabs gitnnolabs Jul 4, 2022

Choose a reason for hiding this comment

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

@Rossi-Luciano concordo com a escolha do campo JSONField! Mas é importante notar que esse é um campo específico do Postgres a partir da versão 9.2.



class Contributor(models.Model):
doi = models.CharField("DOI", max_length=255)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Idem a pergunta de cima?

Copy link
Collaborator

Choose a reason for hiding this comment

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

O contribuidor não tem mesmo relação com os artigos?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

O contribuidor tem relação com os artigos.
Por isso foi mantido os campos doi e doi_url no modelo do contribuidor.

'title',
)
# list_filter = ('source_type',)
# search_fields = ('name', 'source_type')
Copy link
Collaborator

Choose a reason for hiding this comment

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

Importante definir os campos pesquisáveis!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Os campos foram definidos.

'authenticated_orcid',
'affiliation',
)
# list_filter = ('source_type',)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Idem.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Os campos foram definidos.

class ScholarlyArticles(models.Model):
doi = models.CharField("DOI", max_length=255)
doi_url = models.URLField("DOI URL", max_length=255)
genre = models.CharField("Resource Type", max_length=255, choices=choices.TYPE_OF_RESOURCE)
Copy link
Contributor

Choose a reason for hiding this comment

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

O nome do objeto aqui não poderia ser "resource_type" ao invés de genre?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Poderia ser sim.
O nome genre foi utilizado para ficar de acordo com Data Format indicado em https://unpaywall.org/data-format, mas podemos mudar.

('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('doi', models.CharField(max_length=255, verbose_name='DOI')),
('doi_url', models.URLField(max_length=255, verbose_name='DOI URL')),
('genre', models.CharField(choices=[('', ''), ('Book Section', 'book-section'), ('Monograph', 'monograph'), ('Report', 'report'), ('Peer Review', 'peer-review'), ('Book Track', 'book-track'), ('Journal Article', 'journal-article'), ('Part', 'book-part'), ('Other', 'other'), ('Book', 'book'), ('Journal Volume', 'journal-volume'), ('Book Set', 'book-set'), ('Reference Entry', 'reference-entry'), ('Proceedings Article', 'proceedings-article'), ('Journal', 'journal'), ('component', 'Component'), ('Book Chapter', 'book-chapter'), ('Proceedings Series', 'proceedings-series'), ('Report Series', 'report-series'), ('Proceedings', 'proceedings'), ('Standard', 'standard'), ('Reference Book', 'reference-book'), ('Posted Content', 'posted-content'), ('Journal Issue', 'journal-issue'), ('Dissertation', 'dissertation'), ('Grant', 'grant'), ('Dataset', 'dataset'), ('Book Series', 'book-series'), ('Edited Book', 'edited-book'), ('Standard Series', 'standard-series')], max_length=255, verbose_name='Resource Type')),
Copy link
Contributor

Choose a reason for hiding this comment

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

para a tupla de "component" aplicar o mesmo padrão:
de ('component', 'Component')
para ('Component', 'component')

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Corrigido.

FieldPanel('journal_is_in_doaj'),
FieldPanel('journal_issns'),
FieldPanel('journal_issn_l'),
FieldPanel('journal_name'),
Copy link
Contributor

Choose a reason for hiding this comment

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

@robertatakenaka havíamos conversado que o nome do periódico não entraria, certo? Mas eu sou a favor disso. 😎

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Podemos manter ou suprimir de acordo com o entendimento comum.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Penso que podemos manter! Alguém tem alguma objeção?

@gitnnolabs gitnnolabs merged commit c5c9033 into scieloorg:main Jul 5, 2022
@gitnnolabs
Copy link
Collaborator

@Rossi-Luciano

Aprovei e removi a pasta .idea!

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.

3 participants