mirror of
https://github.com/spiral-project/ihatemoney.git
synced 2025-04-30 10:12:37 +02:00
A simple shared budget manager web application
![]() The previous query was working fine on sqlite and mariadb, but not on postgresql : return self.get_bills_unordered().group_by(Bill.original_currency).count() > 1 psycopg2.errors.GroupingError: column "bill.id" must appear in the GROUP BY clause or be used in an aggregate function The failing SQL query was: [SQL: SELECT count(*) AS count_1 FROM (SELECT bill.id AS bill_id, ... 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 = %(id_1)s GROUP BY bill.original_currency) AS anon_1] The problem is that sqlalchemy creates a subquery for postgresql, and the internal query does not make sense. GROUP BY is not actually useful, we simply need to count the number of distinct currencies in the list of bills. |
||
---|---|---|
.github | ||
conf | ||
docs | ||
ihatemoney | ||
.gitignore | ||
.isort.cfg | ||
.travis.yml | ||
CHANGELOG.rst | ||
CONTRIBUTORS | ||
Dockerfile | ||
LICENSE | ||
Makefile | ||
MANIFEST.in | ||
README.rst | ||
SECURITY.md | ||
setup.cfg | ||
setup.py | ||
tox.ini |
I hate money ############ .. image:: https://github.com/spiral-project/ihatemoney/actions/workflows/test-docs.yml/badge.svg :target: https://github.com/spiral-project/ihatemoney/actions/workflows/test-docs.yml :alt: GitHub Actions Status .. image:: https://hosted.weblate.org/widgets/i-hate-money/-/i-hate-money/svg-badge.svg :target: https://hosted.weblate.org/engage/i-hate-money/?utm_source=widget :alt: Translation status from Weblate .. image:: https://img.shields.io/liberapay/receives/IHateMoney.svg?logo=liberapay :target: https://liberapay.com/IHateMoney/donate :alt: Donate *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>`_ * `Mailing list <https://mailman.alwaysdata.com/postorius/lists/info.ihatemoney.org/>`_ (to get updates when needed). 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**: version 3.6 to 3.9. * **Backends**: SQLite, PostgreSQL, MariaDB (version 10.3.2 or above), 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. You can also `donate some money <https://liberapay.com/IHateMoney/donate>`_. All funds will be used to maintain the `hosted version <https://ihatemoney.org>`_. Translation status ================== .. image:: https://hosted.weblate.org/widgets/i-hate-money/-/i-hate-money/multi-blue.svg :target: https://hosted.weblate.org/engage/i-hate-money/?utm_source=widget :alt: Translation status for each language