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

refactor(documentation): partie 2, ajout de modèles abstraits pour réduire l'adhérence à machina #784

Closed
wants to merge 3 commits into from

Conversation

vincentporte
Copy link
Contributor

@vincentporte vincentporte commented Sep 23, 2024

ISSUE #765

Description

🎸 Ajout de modèles abstraits dans utils

  • DatedModel, pour réduire les adhérences avec machina
  • AbstractPublication modèle de contenus éditoriaux : nom, slug, short_description, description en markdown, image) dans utils. Sera réutilisé dans l'app documentation et l'app partner

Type de changement

Technique

Points d'attention

🦺 SUITE PR #783
🦺 maintien du nom des variables created et updated dans DatedModel pour simplifier la transposition
🦺 réutilisation des modèles abstraits

@vincentporte vincentporte changed the base branch from master to 765-part1 September 23, 2024 15:01
@vincentporte vincentporte linked an issue Sep 23, 2024 that may be closed by this pull request
@vincentporte vincentporte changed the title refactor(documentation): partie 2, ajout de l'application documentation refactor(documentation): partie 2, ajout de modèles abstraits pour réduire l'adhérence à machina Sep 23, 2024
@vincentporte vincentporte force-pushed the 765-part2 branch 2 times, most recently from ea55cd7 to a6a67d6 Compare September 23, 2024 15:47
@vincentporte vincentporte marked this pull request as ready for review September 23, 2024 15:53
@vincentporte vincentporte added python Pull requests that update Python code technical debt labels Sep 23, 2024
lacommunaute/utils/abstract_models.py Outdated Show resolved Hide resolved
lacommunaute/utils/abstract_models.py Outdated Show resolved Hide resolved
lacommunaute/utils/abstract_models.py Show resolved Hide resolved
Comment on lines 15 to 31
migrations.AlterField(
model_name="partner",
name="image",
field=models.ImageField(
blank=True,
null=True,
storage=storages.backends.s3.S3Storage(bucket_name="private-bucket", file_overwrite=False),
upload_to="",
validators=[lacommunaute.utils.validators.validate_image_size],
),
),
migrations.AlterField(
model_name="partner",
name="short_description",
field=models.CharField(default="to be updated", max_length=400, verbose_name="Short Description"),
preserve_default=False,
),
Copy link
Contributor

Choose a reason for hiding this comment

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

Il y a les partenaires existantes dans la base de données ? Il y aura possiblement des problèmes avec les deux changements :

  • short_description obligatoire
  • les images existantes seraient stockées dans le bucket sous logos/ ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Bon point !
Effectivement, je n'ai pas trouvé comment modifier le bucket_name du champ ImageField herité de Publication.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

pour les partenaires existants, ils ont tous un short_description complété.

@vincentporte vincentporte marked this pull request as draft November 12, 2024 08:28
@vincentporte vincentporte deleted the 765-part2 branch November 18, 2024 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python Pull requests that update Python code technical debt
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[DETTE TECH] dissocier les Fiches Pratiques de Forum
2 participants