apis_core.history package
Subpackages
- apis_core.history.tests package
- Submodules
- apis_core.history.tests.test_simple_history module
SimpleHistoryTestCase
SimpleHistoryTestCase.setUp()
SimpleHistoryTestCase.test_history()
SimpleHistoryTestCase.test_history_date()
SimpleHistoryTestCase.test_history_delete_entry()
SimpleHistoryTestCase.test_history_merge()
SimpleHistoryTestCase.test_history_tag()
SimpleHistoryTestCase.test_history_through_triples()
SimpleHistoryTestCase.test_m2m_save()
Submodules
apis_core.history.api_views module
- class apis_core.history.api_views.EntityHistoryLogs(**kwargs)[source]
Bases:
ListAPIView
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
- get_queryset()[source]
Get the list of items for this view. This must be an iterable, and may be a queryset. Defaults to using self.queryset.
This method should always be used rather than accessing self.queryset directly, as self.queryset gets evaluated only once, and those results are cached for all subsequent requests.
You may want to override this if you need to provide different querysets depending on the incoming request.
(Eg. return a list of items that is specific to the user)
- serializer_class
alias of
HistoryLogSerializer
- class apis_core.history.api_views.GenericHistoryLog(**kwargs)[source]
Bases:
RetrieveAPIView
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
- get_queryset()[source]
Get the list of items for this view. This must be an iterable, and may be a queryset. Defaults to using self.queryset.
This method should always be used rather than accessing self.queryset directly, as self.queryset gets evaluated only once, and those results are cached for all subsequent requests.
You may want to override this if you need to provide different querysets depending on the incoming request.
(Eg. return a list of items that is specific to the user)
- serializer_class
alias of
HistoryObjectSerializer
apis_core.history.apps module
apis_core.history.models module
- class apis_core.history.models.APISHistoricalRecords(verbose_name=None, verbose_name_plural=None, bases=(<class 'django.db.models.base.Model'>, ), user_related_name='+', table_name=None, inherit=False, excluded_fields=None, history_id_field=None, history_change_reason_field=None, user_model=None, get_user=<function _default_get_user>, cascade_delete_history=False, custom_model_name=None, app=None, history_user_id_field=None, history_user_getter=<function _history_user_getter>, history_user_setter=<function _history_user_setter>, related_name=None, use_base_model_db=False, user_db_constraint=True, no_db_index=[], excluded_field_kwargs=None, history_manager=<class 'simple_history.manager.HistoryManager'>, historical_queryset=<class 'simple_history.manager.HistoricalQuerySet'>, m2m_fields=(), m2m_fields_model_field_name='_history_m2m_fields', m2m_bases=(<class 'django.db.models.base.Model'>, ))[source]
Bases:
HistoricalRecords
,GenericModel
- class apis_core.history.models.APISHistoryTableBase(*args, **kwargs)[source]
Bases:
Model
,GenericModel
- class Meta[source]
Bases:
object
- abstract = False
- constraints = [<UniqueConstraint: fields=('id', Lower(F(version_tag))) name='id_version_tag_unique'>]
- get_triples_for_version(only_latest: bool = True, history_date: datetime = None, filter_for_triples: bool = True)[source]
returns all triples for a specific version of a model instance. If only_latest is True, only the latest version of a triple is returned.
- version_tag
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
apis_core.history.serializers module
- class apis_core.history.serializers.HistoryLogSerializer(*args, **kwargs)[source]
Bases:
Serializer
When a field is instantiated, we store the arguments that were used, so that we can present a helpful representation of the object.
- class apis_core.history.serializers.HistoryObjectSerializer(*args, **kwargs)[source]
Bases:
Serializer
When a field is instantiated, we store the arguments that were used, so that we can present a helpful representation of the object.
apis_core.history.tables module
- class apis_core.history.tables.APISHistoryTableBaseTable(data=None, order_by=None, orderable=None, empty_text=None, exclude=None, attrs=None, row_attrs=None, pinned_row_attrs=None, sequence=None, prefix=None, order_by_field=None, page_field=None, per_page_field=None, template_name=None, default=None, request=None, show_header=None, show_footer=True, extra_columns=None)[source]
Bases:
Table
- base_columns = {'desc': <apis_core.history.tables.DescriptionColumnHistory object>, 'history_id': <django_tables2.columns.base.Column object>, 'original_id': <apis_core.history.tables.OriginalIDColumn object>, 'view': <apis_core.generic.tables.ViewColumn object>}
- class apis_core.history.tables.DescriptionColumnHistory(*args, **kwargs)[source]
Bases:
CustomTemplateColumn
A column showing a model description
- orderable = False
- template_name = 'history/columns/description.html'
- class apis_core.history.tables.HistoryGenericTable(data=None, order_by=None, orderable=None, empty_text=None, exclude=None, attrs=None, row_attrs=None, pinned_row_attrs=None, sequence=None, prefix=None, order_by_field=None, page_field=None, per_page_field=None, template_name=None, default=None, request=None, show_header=None, show_footer=True, extra_columns=None)[source]
Bases:
Table
- class Meta[source]
Bases:
object
- fields = ['model', 'instance', 'tag', 'fields_changed', 'history_type', 'history_date', 'history_user']
- base_columns = {'fields_changed': <django_tables2.columns.templatecolumn.TemplateColumn object>, 'instance': <django_tables2.columns.base.Column object>, 'model': <django_tables2.columns.base.Column object>}
apis_core.history.urls module
apis_core.history.utils module
apis_core.history.views module
- class apis_core.history.views.HistoryView(**kwargs)[source]
Bases:
GenericModelMixin
,SingleTableMixin
,DetailView
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
- template_name = 'history/history.html'