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

[Dépôt de besoin] Stats supplémentaires pour Metabase #939

Merged
merged 4 commits into from
Oct 26, 2023

Conversation

raphodn
Copy link
Contributor

@raphodn raphodn commented Oct 9, 2023

Suite de #949

Quoi ?

Dans Metabase, on a besoin de savoir facilement pour chaque besoin :

  • le nombre de structures concernées
  • le nombre de structures contactées
  • le nombre de structures qui ont vues le besoin / qui ont cliquées sur le mail
  • le nombre de structures intéressées

Or ces stats sont dans TenderSiae, et sont compliquées à calculer et afficher... On créé donc de nouveaux champs dans le modèle Tender, et on les met à jour toutes les nuits.

@raphodn raphodn self-assigned this Oct 9, 2023
@raphodn raphodn force-pushed the raphodn/tender-field-stats branch from 4a7c039 to 23fb1de Compare October 19, 2023 09:44
@raphodn raphodn force-pushed the raphodn/tender-field-stats branch from 23fb1de to 55bb1e9 Compare October 25, 2023 09:42
@raphodn raphodn changed the base branch from master to raphodn/queryset-annotate-rename October 25, 2023 09:54
@raphodn raphodn requested a review from madjid-asa October 25, 2023 12:00
@raphodn raphodn marked this pull request as ready for review October 25, 2023 12:00
self.stdout_messages_info("Updating Tender count fields...")

# Step 1a: build the queryset
tender_queryset = Tender.objects.with_siae_stats().all()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

il y aurait moyen d'optimiser cette requête 🤔

  • seulement les besoins validés
  • date de cloture pas encore passé ?

Copy link
Contributor

@madjid-asa madjid-asa left a comment

Choose a reason for hiding this comment

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

ça me parait good, mais je ne suis pas convaincu de la solution.

Je pense qu'une solution avec des ViewDatabase c'est peut être plus adapté et maintenable. En plus on pourrait les écrire directement dans le code pour mieux maintenir les vues. (cf https://stackoverflow.com/questions/51817841/create-database-view-from-django-model)

Base automatically changed from raphodn/queryset-annotate-rename to master October 26, 2023 09:34
@raphodn raphodn force-pushed the raphodn/tender-field-stats branch from af87015 to a1dc72a Compare October 26, 2023 10:59
@raphodn raphodn merged commit 8ebd5cd into master Oct 26, 2023
4 checks passed
@raphodn raphodn deleted the raphodn/tender-field-stats branch October 26, 2023 11:57
raphodn added a commit that referenced this pull request Dec 5, 2023
* Set company users command: add Slack recap. ref #979

* Set Tender counts command: add Slack recap. ref #939
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.

2 participants