- When Account model is queried with Account.objects, it always add
.select_related('cofprofile_user', 'negative').
- Eg benefits: history doesn't do anymore one request by account to
fill the account filter.
Important
Using this workaround (systemically append select_related) can be
dangerous normally, however a certain number of properties in
cofprofile and user are frequently used (as firstname or lastname), and
the benefits seems greater.
- KFetConfig `set` method now takes model instance instead of their pk
for this type of entries.
- Add tests for KFetConfig class: tests against types currently used by
kfet app (duration, modelinstance, decimal).
- These tests are located in `kfet/tests/test_config.py`. We should
separate tests suites by file like this, considering what they are about.
- KFetConfig method `set_many` renamed to `set` (because it also updates
only one).
Old configuration(/settings), based on Settings model, system is
deleted: SettingsForm, Settings.
New system use `django-djconfig` module.
- `kfet.config` module provides `kfet_config` to access configuration concerning
kfet app.
- Views, forms, models, etc now use this object to retrieve conf values.
- Views no longer add config values to context, instead templates use
`kfet_config` provided by a new context_processor.
- Enhance list and update views of settings.
- Fix: settings can directly be used without having to visit a specific
page...
Misc
- Delete some py2/3 imports
- Delete unused imports in kfet.models and kfet.views
- Some PEP8 compliance
kfet.statistic
- delete no longer used defs
- new mixin - ScaleMixin
- get scale args from GET params
- chunkify querysets according to a scale
Article stats
- use SingleResumeStat for manifest
- use ScaleMixin for sales
- update urls
- update permission required: teamkfet
Account stats
- update permission required: teamkfet
- operations use ScaleMixin
- fix manifests urls
K-Fêt - Statistics
New base class - StatScale
- create scale, given chunk size (timedelta), start and end times
- get labels of
- get start and end datetimes of chunks
DayStatScale: Scale whose chunks interval is 1 day
WeekStatScale: same with 1 week
MonthStatScale: same with 1 month
AccountStatOperationList: manifest of operations stats of an account
- renamed from AccountStatLastAll
- updated according to SingleResumeStat
AccountStatOperation:
- renamed from AccountStatLast
- remove scale logic with use of StatScale objects
- used scale is given by `scale` and `scale_args` GET params
- add filter on operations types with `types` GET param
AccountStatLast(Day,Week,Month) are deleted ("merged" in
AccountStatOperation)
New mixin: PkUrlMixin
- use with SingleObjectMixin standard django mixin (used by
DetailView...)
- `get_object` use field declared in `pk_url_kwarg` to get... the object
SingleResumeStat
- clean (part of) py code
AccountStatBalanceList
- renamed from `AccountStatBalanceAll`
- url modified
- add permission checking (only the connected user can get balance
stats manifest)
- clean py code
AccountStatBalance
- cleaner filtering management
- merge urls using this class
- clean py code
Changement de son propre mot de passe
Permet à un K-Fêteux (disposant de la permission `kfet.is_team`) de modifier son propre mot de passe sur la page `account/XXX/edit`.
Accessoirement, la fonction `account_update` est maintenant conforme à PEP8.
Fix#121
See merge request !148