A simple shared budget manager web application
Find a file
Baptiste Jonglez 2616bed4ff Fix SQL query in has_multiple_currencies
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.
2021-07-10 00:34:43 +02:00
.github Update and rename python-package.yml to test-docs.yml 2021-06-26 23:03:32 +02:00
conf Add BABEL_DEFAULT_TIMEZONE to docker entryfile.sh (#714) 2021-02-04 23:31:45 +01:00
docs Replace MySQL by MariaDB in all documentation / README / changelog 2021-07-05 08:52:13 +02:00
ihatemoney Fix SQL query in has_multiple_currencies 2021-07-10 00:34:43 +02:00
.gitignore Feature/currencies (#541) 2020-04-29 22:57:08 +02:00
.isort.cfg Add isort support. (#561) 2020-04-21 13:59:41 +02:00
.travis.yml Fix travis build with python3.6 (#734) 2021-04-06 22:49:49 +02:00
CHANGELOG.rst Replace MySQL by MariaDB in all documentation / README / changelog 2021-07-05 08:52:13 +02:00
CONTRIBUTORS Integrate illustrations as a showcase (#544) 2020-05-07 22:34:31 +02:00
Dockerfile disable greenlet c++ test to avoid error "Failed building wheel for greenlet" on issue #726 (#727) 2021-04-10 22:31:26 +02:00
LICENSE Re-organize the documentation (#223) 2017-06-21 14:03:16 +02:00
Makefile remove usage of Flask-Script 2021-06-06 15:13:21 +02:00
MANIFEST.in Update known working set. (#558) 2020-04-21 10:30:13 +02:00
README.rst Replace MySQL by MariaDB in all documentation / README / changelog 2021-07-05 08:52:13 +02:00
SECURITY.md Create SECURITY.md 2021-07-06 21:41:49 +02:00
setup.cfg Bump sphinx from 4.0.2 to 4.0.3 2021-07-07 22:35:21 +02:00
setup.py Remove support for python2. 2019-10-11 19:52:37 +02:00
tox.ini Using one job for all linting and doc generation 2021-06-03 22:35:49 +02:00

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