aboutsummaryrefslogtreecommitdiff
path: root/budget/models.py
AgeCommit message (Collapse)AuthorFilesLines
2017-01-02Optimise SQL queries when computing balanceBaptiste Jonglez1-1/+1
This avoids creating thousands of small SQL queries when computing the balance of users. This significantly improves the performance of displaying the main page of a project, since the balance of users is displayed there: Before this commit: 4004 SQL queries, 19793 ms elapsed time, 19753 ms CPU time, 2094 ms SQL time After this commit: 12 SQL queries, 3688 ms elapsed time, 3753 ms CPU time, 50 ms SQL time Measured request: display the sidebar with the balance of all users for the project (without displaying the list of bills) This commit also greatly improves the performance of the "settle bills" page: Before this commit: 8006 SQL queries, 39167 ms elapsed time, 39600 ms CPU time, 4141 ms SQL time After this commit: 22 SQL queries, 7144 ms elapsed time, 7283 ms CPU time, 96 ms SQL time Measured request: display the "Settle bills" page Test setup to measure performance improvement: - 5 users with various weights - 1000 bills, each paid by a random user, each involving all 5 users - laptop with Celeron N2830@2.16 GHz, SSD Samsung 850 EVO - sqlite database on SSD, using sqlite 3.15.2 - python 2.7.13 - Flask-DebugToolbar 0.10.0 (to count SQL queries and loading time) Performance measurements (using Flask-DebugToolbar on the second request, to avoid measuring cold-cache performance): - number of SQL queries - elapsed time (from request to response) - total CPU time consumed by the server handling the request - total time spent on SQL queries (as reported by SQLAlchemy)
2016-06-16Hide the member weights in members list if all weights are "1".Jocelyn Delande1-0/+4
2016-06-15Added member weights support to APIJocelyn Delande1-2/+2
2016-06-15Add members weight in models and budget backend refs #94Jocelyn Delande1-3/+6
2015-07-05Bugfix rounding settle algorithmAlexandre Avenel1-1/+1
In some cases, settle algorithm failed to deliver optimal solution due to a rounding bug.
2015-05-01specified sizes for string columns for MySQLJocelyn Delande1-5/+5
2014-07-22Format numbers in templatesAlexandre Avenel1-1/+1
2014-07-21Fix rounding error in balancesAlexandre Avenel1-1/+1
2013-10-12bugfix #104 : ZeroDivisionErrorA.Avenel1-1/+4
- test if self.owers is null before returning value
2013-05-09Merge pull request #96 from aavenel/masterAlexis Metaireau1-0/+47
New feature : Settle the bill
2013-05-09OptimizationA.Avenel1-4/+6
2013-04-08Bugfix#92 : error when deleting an userA.Avenel1-1/+4
2013-04-07More code cleanup for "settle bills"A.Avenel1-4/+4
2013-04-07use "member.id" instead of "member"A.Avenel1-11/+9
2013-02-19Merge branch 'flask0.9' of github.com:aavenel/ihatemoneyA.Avenel1-1/+1
2013-02-18update for flask 0.9A.Avenel1-1/+1
2012-11-03Merge git://github.com/Lastpixl/ihatemoney into HEADA.Avenel1-1/+48
Conflicts: budget/templates/layout.html budget/templates/list_bills.html
2012-05-19Switched to the new naming scheme for extensionsAlexis Metaireau1-1/+1
2012-03-28Merge branch 'master' of git://github.com/spiral-project/ihatemoneyFrédéric Sureau1-6/+12
2012-03-12Split bills function and basic template.Xavier Mehrenberger1-1/+48
2012-03-06code reread: noop, and pep8 <3Feth AREZKI1-6/+12
2012-01-28Correct bug in members model. The has_bills method did not worked as ↵Frédéric Sureau1-1/+1
expected. Fix #73.
2011-12-03Fix for a bug introduced in last commit : crash of dashboard view when there ↵A.Avenel1-0/+4
is no bill.
2011-11-02Add a way to delete a project. Fix #63Arnaud Bos1-0/+4
2011-10-18Document the API. Fix #46Alexis Metaireau1-3/+4
2011-10-18Use the relation table for "has_bills".Alexis Metaireau1-4/+3
This fixes a bug related to the way we made joins to query q postgresql db. I found that we didn't needed at all any join, so a simple lookup in the m2m relation table allows to speed up things. Fix #44
2011-10-15Translate the application using Flask-babel.Alexis Metaireau1-1/+0
The only translation so far is french, but more can be added. The browser language is used thanks to the HTTP languages headers. There are still some problems with the translation of some strings, I don't know why this is. See #12
2011-10-13Fix some problems related to postgresql and modelsAlexis Metaireau1-2/+2
2011-10-08Round the balance. Fix #1Alexis Metaireau1-1/+1
2011-10-08Complete the REST API + Tests. Fix #27Alexis Metaireau1-8/+7
2011-09-13API: Create and Update supportAlexis Metaireau1-2/+17
2011-09-13REST API is now able to list stuff \o/Alexis Metaireau1-1/+26
2011-09-13Add a serialization mechanismAlexis Metaireau1-0/+7
2011-09-09Move some logic to the models and add comments.Alexis Metaireau1-0/+27
2011-09-09Start working on archive managementAlexis Metaireau1-0/+17
2011-08-10Add some more tests about membership. (#14)Alexis Metaireau1-1/+1
Fixes #15 as invalid: deactivated users are not listed on the bill form or on the balance.
2011-08-09Users are deleted when no bill is assigned to them. Fixes #5Frédéric Sureau1-0/+8
2011-07-31Makes the computation working.Alexis Metaireau1-1/+25
2011-07-31Adding a bill is now working properlyAlexis Metaireau1-0/+3
2011-07-23Manage users creationAlexis Metaireau1-1/+1
2011-07-23Split the logic into different python modules:Alexis Metaireau1-0/+54
* web.py contains the controllers (also called views) + url definitions * models.py contains the models * forms.py contains the forms * utils.py contains a set of utility fonctions to ease the dev. process