models#
SystemCreatorBaseModel#
CustomSoftDeletableQuerySet#
Bases: QuerySet
Customized version of model_utils SoftDeletableQuerySet
QuerySet for SoftDeletableModel. Instead of removing instance sets
its removed
field to timestamp.
Source code in src/apps/common/models.py
CustomSoftDeletableManager#
Bases: Manager
Customized version of model_utils SoftDeletableManager Manager that limits the queryset by default to show only not removed instances of model.
Source code in src/apps/common/models.py
get_queryset()
#
Return queryset limited to not removed entries.
Source code in src/apps/common/models.py
CustomSoftDeletableModel#
Bases: Model
Customized version of model_utils SoftDeletableModel
Source code in src/apps/common/models.py
delete(using=None, soft=True, *args, **kwargs)
#
Soft delete object (set its removed
field to current time).
Actually delete object if setting soft
to False.
Source code in src/apps/common/models.py
AbstractBaseModel#
Bases: SystemCreatorBaseModel
, TimeStampedModel
, CustomSoftDeletableModel
Adds soft-delete and created / modified timestamp functionalities
Added fields are
- created
- modified
- removed
Source code in src/apps/common/models.py
AbstractDatasetProperty#
Bases: AbstractBaseModel
Base class for simple refdata fields with only id and title properties
Attributes:
Name | Type | Description |
---|---|---|
title |
HstoreField
|
property title |
url |
URLField
|
property url |
Source code in src/apps/common/models.py
AbstractFreeformConcept#
Bases: AbstractBaseModel
Permissive version of concept object with added custom fields
Necessary for objects that do not conform to the requirements of reference data. Should only be used with core-app.
Attributes:
Name | Type | Description |
---|---|---|
title |
HstoreField
|
property title, usually this would be pref_label in reference data |
pref_label |
HStoreField
|
title of the concept |
description |
HStoreField
|
detailed freeform description of the concept |
in_scheme |
URLField
|
scheme of the concept |
Source code in src/apps/common/models.py
ProxyBasePolymorphicModel#
Bases: PolymorphicModel
Base class for models instantiated as one of their proxy classes.
Provider helper functions for choosing proxy class based on value defined by proxy_lookup_field.
Mapping of proxy_lookup_field values to proxy models is determined by the proxy_mapping dict.
Actual class is determined by polymorphic_ctype_id ContentType field.
Source code in src/apps/common/models.py
get_proxy_classes()
classmethod
#
Get proxy subclasses and also current class if it's a proxy.
get_proxy_instance(*args, **kwargs)
classmethod
#
Return new proxy model instance with supplied arguments.
Proxy model is determined from proxy lookup field value in keyword arguments.
Source code in src/apps/common/models.py
get_proxy_model(lookup_value)
cached
classmethod
#
Return proxy model corresponding to lookup_value.
Source code in src/apps/common/models.py
get_proxy_subclasses()
classmethod
#
Get all proxy subclasses recursively.
Source code in src/apps/common/models.py
save(*args, **kwargs)
#
Raise error if proxy_lookup_field value does not match current model.