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

Add statistics #45

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Add statistics #45

wants to merge 3 commits into from

Conversation

m-rtijn
Copy link
Owner

@m-rtijn m-rtijn commented Jun 21, 2022

First work for #30

@m-rtijn m-rtijn requested a review from tweska April 30, 2023 10:08
<h1>Statistieken</h1>
<ul>
<li>Totaal aantal producten: {{ total_products }}</li>
<li>Totaal aantal aanbiedingen van producten: {{ total_offers }}.</li>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ik denk dat voor veel gebruikers niet heel duidelijk zal zijn wat hier precies staat. Het is denk ik niet heel duidelijk wat het verschil tussen de 1e en de 2e is. Het woord "aanbiedingen" heeft ook een dubbele betekenis.


products: List[Product] = Product.query.all()

total_product: int = len(products)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Lijkt me een beetje zonde om alle producten in te laden alleen om te kijken hoe lang de lijst is.

Kunnen we niet dit gebruiken: https://docs.sqlalchemy.org/en/20/orm/queryguide/query.html#sqlalchemy.orm.Query.count

Copy link
Owner Author

Choose a reason for hiding this comment

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

Hmm dat klinkt wel beter, maar misschien ook eens uitzoeken wat de SQLAlchemy v2.0 manier is om dat te doen

Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Owner Author

Choose a reason for hiding this comment

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

dat lijkt me de nieuwe versie inderdaad

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