Implement shared domain models in core/models.py#54
Draft
Conversation
…, FlexibleDate) and abstract models (TextWithLang, TextLanguageMixin, RichTextWithLanguage, FileWithLang) to core/models.py Co-authored-by: robertatakenaka <505143+robertatakenaka@users.noreply.github.com> Agent-Logs-Url: https://github.com/scieloorg/markapi/sessions/87eea582-78f5-4df3-8dd9-5115e4f29c2f
Copilot
AI
changed the title
[WIP] Add shared domain models in core/models.py
Implement shared domain models in core/models.py
Mar 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
O que esse PR faz?
Porta os modelos de domínio compartilhado do scieloorg/core para este repositório, permitindo que módulos reutilizem entidades comuns (
Language,Gender,License, etc.) sem redefinição.Modelos concretos (com migração):
Gender,Language,License,LicenseStatement,FlexibleDateModelos abstratos:
TextWithLang,TextLanguageMixin,RichTextWithLanguage,FileWithLangInfraestrutura adicionada:
core/choices.py— constantesLANGUAGE(185 códigos ISO 639-1),GENDER_CHOICES,LICENSE_TYPES,MONTHScore/utils/utils.py—language_iso()usandolangcodespara normalização de códigosLanguageFallbackManager— manager com fallbackpt → es → enlangcodes==3.5.1emrequirements/base.txtOnde a revisão poderia começar?
core/models.py— contém todos os modelos e oLanguageFallbackManager.Como este poderia ser testado manualmente?
DATABASE_URL=sqlite:///db.sqlite3 CELERY_BROKER_URL=redis://localhost:6379/0 \ USE_DOCKER=no DJANGO_SETTINGS_MODULE=config.settings.local \ python manage.py test core.tests -v242 testes cobrindo:
language_iso()normalização (hyphen/underscore split, empty, None, invalid)Gender.create_or_updateeunique_togetherLanguage.get_or_createcom normalização vialanguage_iso()eload()idempotenteLicense.getcomiexacteunique_togetherLicenseStatement.parse_urlextração delicense_type/license_versionFlexibleDate.datapropertyabstract=True/Falseem todos os modelosAlgum cenário de contexto que queira dar?
Estes modelos são equivalentes aos do repositório
scieloorg/coree seguem os mesmos contratos. Exemplo de uso:Screenshots
N/A — sem alterações visuais.
Quais são tickets relevantes?
N/A
Referências
unique_togetherRichTextFieldOriginal prompt
core/models.py#50✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.