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

feat(Open Data): Ajout de champs manquants pour les déclarations #1475

Merged
merged 20 commits into from
Jan 23, 2025

Conversation

qloridant
Copy link
Collaborator

@qloridant qloridant commented Jan 16, 2025

Il me reste une interrogation sur le champ date_decision

@qloridant qloridant linked an issue Jan 16, 2025 that may be closed by this pull request
10 tasks
@qloridant qloridant changed the title 1442 featopen data ajout de champs manquants feat(Open Data): Ajout de champs manquants pour les déclarations Jan 16, 2025
@qloridant qloridant marked this pull request as ready for review January 16, 2025 16:19
for declared_ingredient in obj.declared_ingredients.filter(ingredient__ingredient_type=5)
]

def get_date_decision(self, obj):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Je te remets ici le commentaires de mattermost

   @property
    def acceptation_date(self):
       if status != "AUTHORIZED": 
           return None
        try:
            latest_snapshot = self.snapshots.latest(
                "creation_date"
            )
            return latest_snapshot.creation_date
        except Snapshot.DoesNotExist:
            return None

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done c92d089
(avec qq modifs de code)

Copy link
Collaborator

@pletelli pletelli left a comment

Choose a reason for hiding this comment

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

Quelques changements nécesaires :

  • sur get_article_reference
  • sur get_acceptation_date

Le reste c'est juste des petites remarques.
Je suis dispo si tu veux en discuter.

"declared_microorganisms",
"declared_substances",
"modification_date",
"article_reference",
Copy link
Collaborator

Choose a reason for hiding this comment

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

j'ai vu que ça s'appellait aussi "procédure" dans TeleIcare.
Peut-être que "article_procedure" pourrait mieux marcher.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ok !
770aa98

def get_marque(self, obj):
return obj.brand

def get_gamme(self, obj):
Copy link
Collaborator

Choose a reason for hiding this comment

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

cette méthode n'est pas obligatoire (comme le nom du champ et le nom du champ traduit sont les mêmes).
mais tu l'as peut être laissée pour la lisibilité ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oui ! Mais je peux supprimer :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Dans le doute j'ai documenté son caractère inutile en terme de code

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@@ -337,13 +379,34 @@ def get_article(self, obj):
else:
Copy link
Collaborator

Choose a reason for hiding this comment

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

je n'avais pas vu ça passer la dernière fois, désolée.
Pour l'article on va utiliser plutôt le champ article qui est un GeneratedField (à partir de calculated_article et overriden_article, qui prévaut sur calculated_article).
Donc il faut plutôt appeler

if "Article 15" in obj.get_article_display():
        return "Article 15"
else:
        return obj.get_article_display()

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@pletelli pletelli self-requested a review January 23, 2025 13:10
@qloridant qloridant merged commit d4c6f42 into staging Jan 23, 2025
5 checks passed
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.

feat(Open-Data): Ajout de champs manquants
2 participants