Skip to content

Add statistics#45

Open
m-rtijn wants to merge 3 commits intomasterfrom
add-statistics-page
Open

Add statistics#45
m-rtijn wants to merge 3 commits intomasterfrom
add-statistics-page

Conversation

@m-rtijn
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
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