-
Notifications
You must be signed in to change notification settings - Fork 4
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
base: master
Are you sure you want to change the base?
Add statistics #45
Conversation
<h1>Statistieken</h1> | ||
<ul> | ||
<li>Totaal aantal producten: {{ total_products }}</li> | ||
<li>Totaal aantal aanbiedingen van producten: {{ total_offers }}.</li> |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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
First work for #30