Support non-equally split shares + various fixes#25
Open
tobast wants to merge 14 commits intobartromgens:masterfrom
Open
Support non-equally split shares + various fixes#25tobast wants to merge 14 commits intobartromgens:masterfrom
tobast wants to merge 14 commits intobartromgens:masterfrom
Conversation
Still lacks a proper CSS for now, and maybe a bit of JS.
Inheriting from TemplateView broke eg. the `.object` or `.objects_list` from `ListView`, `CreateView`, etc.
Check negative weights, division by zero, …
a2ddfb7 to
03dd4a5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is quite a lengthy PR, sorry for the huge review. Fixes #23.
High level overview
u1, u2, u3participate with respective weights1,2,1.25, for a total of4.25,u1would pay1/4.25th of the price,u2,2/4.25th of the price, etc. Note that the weights are purely arbitrary and only the fractionuser_weight / total_weightcounts.GroupAccount, saved under a name (eg. "rent"). This can come in handy if the same subset of people is often used, and if this group usually requires weighting.Technical overview
1.0for everyone.throughmodel for theManyToManyrelationship betweenTransactions andUserProfile. This, however, requires a bit of implementation and refactoring.throughmodel to the new custom one is a tricky one — but I tested it heavily and I believe it safe.path()instead ofurl()inurls.py(Django 2 style)BaseView->BaseMixin, do not inherit fromTemplateViewanymore: this was breaking views that were notTemplateViews (eg.CreateView) becasue eg.get()does not generally call thesuper()-method.