The code has been ported into the accelerate project; this repository is no longer in use or receiving updates, and will be decomissioned presently.
Accelerator is a simple Django package which provides models for the MassChallenge Accelerator applications.
The package supports two modes of use, in two different Django apps:
accelerator_abstract
- abstract models, declaring all the fields and relationships between the Base-models. All the models were made to be swappable,using Django-swappable-models.accelerator
- regular concrete django models, ready for use. Those models are the default concrete implementation of the abstract models defined inaccelerator_abstract
.
The package also includes a third django app, simpleuser
, that
slightly extends the default django user model. It is also swappable,
in the usual way.
The development environment for Accelerate and Impact-API were configured to use django-accelerator as an editable source.
Follow the instructions on Setting Up The Development Environment for further details.
-
Add "accelerator" to your INSTALLED_APPS setting like this:
INSTALLED_APPS = [ ... 'accelerator.apps.AcceleratorConfig', ]
2. Run python manage.py migrate
3. The installed models should now appear in your application's admin and through the Django shell.
Since Django-accelerator uses Swappable Models. changing the Django models is slightly different than usual.
The key differences to note are:
-
All the model declarations - Django fields, methods, meta configration, etc. - should live in the respective Base model, inside
accelerator_abstract.models
. This makes the changes usable both by theaccelerator
app, and any app that inherits directly fromaccelerator_abstract
and declares its own concrete models. -
The Concrete model in
accelerator
should have no other role but:- to be a concrete subclass of a base model.
- to declare the
Meta.swappable
configuration.
E.g. the Startup model looks like this:
<