-
Notifications
You must be signed in to change notification settings - Fork 5
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
Reports #277
Reports #277
Conversation
) | ||
|
||
|
||
# SQL for diners 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.
The idea of Django is that you don't have to focus on SQL queries. Is the reason you placed the commented SQL queries purely as a replacement for test-cases? If so, honestly, I think it's not neccessary honestly as long as the function is well documented in what it intends to do.
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.
I used the generated SQL queries to come up with the correct QuerySet code and check that it's correct. It's much easier to see what is happening in the SQL and whether I would need to use DISTINCT
somewhere. I left the queries there just for documentation.
The idea for Django's ORM is not to not use SQL, but as an abstraction so that you can use multiple databases with their own SQL dialects, and as a mapper between rows and Python objects ('Object Relational Mapping'). There is nothing wrong with SQL, in fact I would prefer it if the object mapping wasn't such a great feature of Django.
Finance reports:
Dining reports:
Screenshots: