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(ETL): Utilser QuerySet et Serializer pour publier les cantines dans Metabase #4884

Merged
merged 11 commits into from
Jan 16, 2025

Conversation

qloridant
Copy link
Collaborator

No description provided.

@qloridant qloridant linked an issue Jan 10, 2025 that may be closed by this pull request
@qloridant qloridant marked this pull request as ready for review January 13, 2025 08:42
@@ -529,6 +532,8 @@ def get_is_managed_by_user(self, obj):

# remember to update TD version if you update this
class CanteenTeledeclarationSerializer(serializers.ModelSerializer):
geo_data = {"department": {i.value: i.label for i in Department}, "region": {i.value: i.label for i in Region}}
Copy link
Member

Choose a reason for hiding this comment

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

utilisé ?



class CanteenMetabaseSerializer(serializers.ModelSerializer):
departments_lib = {i.value: i.label.split(" - ")[1] for i in Department}
Copy link
Member

Choose a reason for hiding this comment

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

pourquoi les rajouter à la class ? vu qu'ils sont déjà accessibles sous forme de constants dans un autre fichier

return obj.department

def get_departement_lib(self, obj):
return self.departments_lib[obj.department]
Copy link
Member

Choose a reason for hiding this comment

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

plutôt rajouter une méthode coté department_choices.py et y faire appel ici
(exemple similaire ci-dessous avec get_modele_economique)

macantine/etl/utils.py Outdated Show resolved Hide resolved
qloridant and others added 2 commits January 13, 2025 12:32
Co-authored-by: Raphaël Odini <raphodn@users.noreply.github.com>
@qloridant
Copy link
Collaborator Author

qloridant commented Jan 13, 2025

Je propose que le refactor du map_sectors() soit pris en compte dans une prochaine PR (il va y en avoir plusieurs pour prendre en compte tous les jeux de données)

Suite du refactor dont faudra discuter ensemble d'ailleurs

…ma-cantine into 4756-refacto-queryset-opendata
@qloridant qloridant merged commit fe674ff into staging Jan 16, 2025
6 of 7 checks passed
@qloridant qloridant deleted the 4756-refacto-queryset-opendata branch January 16, 2025 11:02
raphodn added a commit that referenced this pull request Jan 17, 2025
…es dans Metabase (#4884)

Co-authored-by: Raphaël Odini <raphodn@users.noreply.github.com>
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.

Analyses : Ajout de champs
2 participants