-
Notifications
You must be signed in to change notification settings - Fork 6
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
Conversation
Suspeito que essa pasta .idea não faz parte do PR correto? |
@Rossi-Luciano @robertatakenaka Não iremos criar um campo para armazenar o JSON? |
scholarly_articles/models.py
Outdated
|
||
|
||
class ScholarlyArticles(models.Model): | ||
doi = models.CharField("DOI", max_length=255) |
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.
Todos os campos são realmente obrigatórios?
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.
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
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.
@Rossi-Luciano quando eu for aprovar irei remover, vou colocar na lista de pastas para ser ignorada!
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.
@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.
scholarly_articles/models.py
Outdated
|
||
|
||
class Contributor(models.Model): | ||
doi = models.CharField("DOI", max_length=255) |
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.
Idem a pergunta de cima?
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.
O contribuidor não tem mesmo relação com os artigos?
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.
O contribuidor tem relação com os artigos.
Por isso foi mantido os campos doi
e doi_url
no modelo do contribuidor.
scholarly_articles/wagtail_hooks.py
Outdated
'title', | ||
) | ||
# list_filter = ('source_type',) | ||
# search_fields = ('name', 'source_type') |
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.
Importante definir os campos pesquisáveis!
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.
Os campos foram definidos.
scholarly_articles/wagtail_hooks.py
Outdated
'authenticated_orcid', | ||
'affiliation', | ||
) | ||
# list_filter = ('source_type',) |
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.
Idem.
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.
Os campos foram definidos.
scholarly_articles/models.py
Outdated
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) |
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.
O nome do objeto aqui não poderia ser "resource_type" ao invés de genre?
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.
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')), |
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.
para a tupla de "component" aplicar o mesmo padrão:
de ('component', 'Component')
para ('Component', 'component')
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.
Corrigido.
FieldPanel('journal_is_in_doaj'), | ||
FieldPanel('journal_issns'), | ||
FieldPanel('journal_issn_l'), | ||
FieldPanel('journal_name'), |
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.
@robertatakenaka havíamos conversado que o nome do periódico não entraria, certo? Mas eu sou a favor disso. 😎
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.
Podemos manter ou suprimir de acordo com o entendimento comum.
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.
Penso que podemos manter! Alguém tem alguma objeção?
Aprovei e removi a pasta .idea! |
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