Order create view use WeekScale. No query improvements, only shorter
code.
Scale/ScaleMixin:
- Two methods directly relative to the Scale class move to... the Scale
class.
- Fix order create on Chrome.
Scales:
- Fix #chunks when used with std_chunk=True (there was one too many at
the beginning)
- Scale.end gives the end of the last chunk (instead of its start)
So scale.begin -> scale.end gives the full range of the scale.
`kfet_day` now returns an aware datetime.
ScaleMixin:
- new method `get_by_chunks` which use only one query and ranks
elements according to the scale. Elements are returned by a generator
for each scale chunk (and all chunks are returned as a generator too).
ArticlesStatSales and AccountStatOperations use this new method to
avoid issuing #scale_chunks queries.
ArticleStat:
- fixed on Chrome
We reproduce what has been done here:
https://github.com/dissemin/dissemin
The following files can be found under `cof/settings/`
- `common.py`: the settings that are shared by all the environments we
have + the secrets (see below).
- `dev.py`: the settings used by the vagrant VM for local development.
- `prod.py`: the production settings (for both www.cof.ens.fr and
dev.cof.ens.fr)
There is also a notion of "secrets". Some settings like the `SECRET_KEY`
or the database's credentials are loaded from an untracked files called
`secret.py` in the same directory. This secrets are loaded by the common
settings file.
- Cache use db #1 of redis.
- Channel layer (of channels) use db #0 of redis.
- `settings` try getting redis connection variables from environment.
- Drop memcached system
- kfet_config gives "reduction_cof" as editable instead of
"subvention_cof"
- this last one can still be accessed via kfet_config (computed from
new "reduction_cof"
- add units to numeric values of kfet_config form
- PermConsumerMixin allows checking permissions on connection to a
consumer.
- KPsul consumer uses this mixin to check if connecting user has the
permission `kfet.is_team`.
Fixes#67.
- Use last official releases of channels, asgiref, daphne and
asgi-redis packages.
- Customization of JsonWebsocketConsumer is now in kfet app through a
custom class (and so, doesn't require anymore a forked version of channels).
- Clean kfet consumers code.
- Fewer requests on choicesreventes and tabular inlines (of
attributions)
- User and tirage cannot be updated if updating a participant instance.
- Tabular inlines are fixed:
- the one which is used for spectacles with listing only propose
choices in spectacle with listing
- same with the other (spectacles without listing)
- Still does too much request (because of tabularinlines)
- New attribution form issue less queries
- Spectacle and Participant are readonly if updating an attribution.
ReadOnlyMixin allows to set readonly fields only while updating an
object.
bda.algorithm
- use iterator to find max_groups, instead of a db request
bda.views.do_tirage
- select_related() are now focused on some relationships (they were
taking useless relationships)
- bda-revente filling takes 1 request (each save and add was issuing
1 request)
bda.views.etat_places
- Use select_related on spectacles_set, avoid query issue for each spectacle.
- `slots__sum` is computed in view, instead of a query.
- Cleaner code (and avoid useless computations).
bda.views.places
- Add select_related on places, avoid query issue for each spectacle.
bda.views.inscription
- 1 query for spectacle field choices, instead of (#forms in formset *
#spectacles)
- Delete BaseBdaFormSet. The validation was redundant with
`unique_together` of ChoixSpectacle model.