mirror of
https://github.com/spiral-project/ihatemoney.git
synced 2025-05-05 20:51:49 +02:00
A simple shared budget manager web application
![]() I don't know why, the old ORM was generating this query: ```SQL SELECT bill.id AS bill_id, bill.payer_id AS bill_payer_id, bill.amount AS bill_amount, bill.date AS bill_date, bill.what AS bill_what, bill.archive AS bill_archive FROM bill JOIN person ON person.id = bill.payer_id JOIN project ON project.id = person.project_id WHERE bill.payer_id = person.id AND person.project_id = project.id AND project.id = ? ORDER BY bill.date DESC, bill.id DESC ``` which seems OK, given the code. But, on my setup, this now returns ALL bills from ALL projects. This is weird, it is late, I'm tired, and I found that removing the `WHERE` constraints (except the one for the project id) fix this issue. The new code generate this: ```SQL SELECT bill.id AS bill_id, bill.payer_id AS bill_payer_id, bill.amount AS bill_amount, bill.date AS bill_date, bill.what AS bill_what, bill.archive AS bill_archive FROM bill JOIN person ON person.id = bill.payer_id JOIN project ON project.id = person.project_id WHERE project.id = ? ORDER BY bill.date DESC, bill.id DESC ``` which seems better, given the fact that the `JOIN` clause already restricts things. Please test this on your local branch. |
||
---|---|---|
conf | ||
docs | ||
ihatemoney | ||
.gitignore | ||
.travis.yml | ||
CHANGELOG.rst | ||
CONTRIBUTORS | ||
dev-requirements.txt | ||
Dockerfile | ||
LICENSE | ||
Makefile | ||
MANIFEST.in | ||
README.rst | ||
requirements.txt | ||
setup.py | ||
tox.ini |
I hate money ############ .. image:: https://travis-ci.org/spiral-project/ihatemoney.svg?branch=master :target: https://travis-ci.org/spiral-project/ihatemoney :alt: Travis CI Build Status «I hate money» is a web application made to ease shared budget management. It keeps track of who bought what, when, and for whom; and helps to settle the bills. * `Online documentation <https://ihatemoney.readthedocs.org>`_ * `Hosted version <https://ihatemoney.org>`_ The code is distributed under a BSD *beerware* derivative: if you meet the people in person and you want to pay them a craft beer, you are highly encouraged to do so. Requirements ============ * **Python**: 2.7, 3.4, 3.5, 3.6. * **Backends**: MySQL, PostgreSQL, SQLite, Memory. Contributing ============ Do you wish to contribute to IHateMoney? Fantastic! There's a lot of very useful help on the official `contributing <https://ihatemoney.readthedocs.io/en/latest/contributing.html>`_ page.