Django models, managers and mixins
For supporting generational data with django-genia
Bases: django.db.models.base.Model
Stores history of data generations for a given app
Parameters: |
|
---|
Set the model to be the active generation for its app
If there is already an active generation, it will be unset.
Override base model save method
Automatically sets the index of a new generation to the right (incremented) value.
Bases: django.db.models.manager.Manager
Manager for generation objects
Get the one active generation for the given app
Parameters: | app_name (String) – Name of the app |
---|---|
Returns: | Active generation |
Return type: | Generation object |
Bases: django.db.models.manager.Manager
Manager for models that are implementing generational data
Override the base get_query_set
Returns: | Current QuerySet filtered to only objects in the active generation |
---|---|
Return type: | QuerySet object |
Bases: django.db.models.base.Model
Mixin class for models that represent generational data
Parameters: | generation_id (ForeignKey to Generation) – Generation |
---|
Get the active generation for this model’s application data
Returns: | Active generation for the model’s app |
---|---|
Return type: | Generation object |