Progress report
- from next week, please send the progress report to the mailing list
- please send your daily check in in the gitter channel dedicated to the project you're working on
Swappable models across OpenWISP
I wanted to take some time to investigate what's the best way to implement this across OpenWISP.
I was exploring the possibility of allowing users to just swap models, without the need of creating a custom app altogether.
After reading the following:
I concluded that what we're doing in the
Firmware Upgrade module is most probably the best thing currently available at the moment, for the following reasons:
- we force the creation of separate migration files, which can diverge from the base app without creating issues that are too complicated to resolve
- migrating from the base module to the customized version of the module should be just a matter of creating the tables and migrate the data to it
- we explain in the README how to reuse and extend all the important classes
Using django-swappable is therefore not extremely needed, but it's still helpful because it allows us to write base classes (eg: views) which load the concrete models using the swappable API, so when a module is extended, those views can be just imported and won't need to be touched much.
Without django-swappable, we would have had to write more boilerplate code, because the wouldn't have been able to load concrete models in base classes (because doing so would make it impossible to extend the modules since django will try to load the concrete models but won't find the app in INSTALLED_APPS and hence raise an exception) so it's still useful, even though we will not officially support the possibility of swapping only one particular model and not all of them. although it may still be doable, but I will not dedicate more time to this now; we may make an exception for the User model, which would be an interesting use case to support, we'll investigate in the near future.
If you have suggestions regarding improvements to the README, please send them asap.
Other general indications
Federico