Create app Organization#944
Conversation
…tion e cria Organization
| location = models.ForeignKey( | ||
| Location, on_delete=models.SET_NULL, null=True, blank=True | ||
| ) | ||
| panels = [ |
There was a problem hiding this comment.
@samuelveigarangel remover os excedentes de Base, e transferir para Organization
| AutocompletePanel("institution_type_scielo"), | ||
| FieldPanel("is_official"), | ||
| ] | ||
| autocomplete_search_field = "name" |
There was a problem hiding this comment.
Acho que por enquanto, podemos deixar assim.
| autocomplete_search_field = "name" | ||
|
|
||
| def __str__(self): | ||
| return f"{self.name}" |
There was a problem hiding this comment.
@samuelveigarangel adicionar location para ajudar na identificação. Sugiro colocar o país no início. Muitas instituições tem o mesmo nome, por exemplo: Hospital Geral....
| return f"{self.name}" | ||
|
|
||
| def autocomplete_label(self): | ||
| return str(self) |
| location, | ||
| ): | ||
| params = {} | ||
| if name: |
There was a problem hiding this comment.
@samuelveigarangel acho que name e location devem ser obrigatórios
| url, | ||
| logo, | ||
| institution_type_mec, | ||
| institution_type_scielo, | ||
| location, | ||
| is_official, |
There was a problem hiding this comment.
@samuelveigarangel remover os excedentes de Base e mover para Organization
| location=None, | ||
| url=None, | ||
| logo=None, | ||
| institution_type_mec=None, | ||
| institution_type_scielo=None, | ||
| is_official=None, |
There was a problem hiding this comment.
@samuelveigarangel mover os excedentes de Base para Organization
|
|
||
|
|
||
| # Dynamic OrgLevel class creation | ||
| def create_org_level_class(org_class_name): |
| return type(f"OrgLevel{org_class_name}", (BaseOrgLevel,), attrs) | ||
|
|
||
|
|
||
| class BaseOrgLevel(CommonControlField): |
There was a problem hiding this comment.
@samuelveigarangel como é abstrat, eu acho que não herda de CommonControlField, porque isso estará na classe que é usada combinando com BaseOrgLevel, não acha?
There was a problem hiding this comment.
Eu vou utilizar a função create_org_level_class para criar as relações com as classes History de forma dinamica. Então, ao chamar a funcao, ele vai criar todos os campos.
|
|
||
|
|
||
| @celery_app.task() | ||
| def task_migrate_date_institution_to_organization_publisher( |
There was a problem hiding this comment.
@samuelveigarangel sugiro não fazer isso porque isso replicará o problema que já temos de dados incompletos e repetidos, variações do nome de mesma instituição, ...
There was a problem hiding this comment.
Mas então, em algum momento todos os dados vão ser migrados. ACho que faz sentido manter, adicionar apenas um paramentro para migrar apenas os official.
| user_id, username, model, collection, journal | ||
| ): | ||
| model = apps.get_model("institution", model) | ||
| objects = model.objects.all() |
There was a problem hiding this comment.
@samuelveigarangel no lugar de .all(), use .filter(is_official=True), ou outro filtro, que resulte em uma seleção de organizações com dado padronizado
robertatakenaka
left a comment
There was a problem hiding this comment.
@samuelveigarangel verficar comentários
| acronym, | ||
| location, | ||
| ): | ||
| if not name: |
| ) | ||
|
|
||
| panels = BaseOrganization.panels + [ | ||
| FieldPanel("url"), |
- improve Organization.get
O que esse PR faz?
Cria toda a estrutura do aplicação Organization que irá armazenar os dados relacionado a publisher, owner, copyright, sponsor e affiliation.
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
Quais são tickets relevantes?
#926
Referências
N/A