apis_core.apis_entities package
Subpackages
- apis_core.apis_entities.migrations package
Submodules
apis_core.apis_entities.abc module
- class apis_core.apis_entities.abc.E21_Person(*args, **kwargs)[source]
Bases:
Model
- date_of_birth
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- date_of_death
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- forename
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- gender
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- surname
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- class apis_core.apis_entities.abc.E53_Place(*args, **kwargs)[source]
Bases:
Model
- label
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- latitude
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- longitude
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
apis_core.apis_entities.api_views module
- class apis_core.apis_entities.api_views.GetEntityGeneric(**kwargs)[source]
Bases:
APIView
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
- class apis_core.apis_entities.api_views.ListEntityGeneric(**kwargs)[source]
Bases:
ListAPIView
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
- filter_backends = [<class 'apis_core.utils.filters.CustomSearchFilter'>]
- 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
MinimalEntitySerializer
apis_core.apis_entities.apps module
apis_core.apis_entities.autocomplete3 module
- class apis_core.apis_entities.autocomplete3.PropertyAutocomplete(**kwargs)[source]
Bases:
Select2ListView
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
- SELF_OBJ_OTHER_SUBJ_STR = 'self_obj_other_subj'
- SELF_SUBJ_OTHER_OBJ_STR = 'self_subj_other_obj'
apis_core.apis_entities.fields module
- class apis_core.apis_entities.fields.ListSelect2(url=None, forward=None, *args, **kwargs)[source]
Bases:
Select2WidgetMixin
,ListSelect2
Instanciate a widget with a URL and a list of fields to forward.
- property media
Return JS/CSS resources for the widget.
- class apis_core.apis_entities.fields.ModelSelect2(url=None, forward=None, *args, **kwargs)[source]
Bases:
Select2WidgetMixin
,ModelSelect2
Instanciate a widget with a URL and a list of fields to forward.
- property media
Return JS/CSS resources for the widget.
- class apis_core.apis_entities.fields.ModelSelect2Multiple(url=None, forward=None, *args, **kwargs)[source]
Bases:
Select2WidgetMixin
,ModelSelect2Multiple
Instanciate a widget with a URL and a list of fields to forward.
- property media
Return JS/CSS resources for the widget.
- class apis_core.apis_entities.fields.Select2(url=None, forward=None, *args, **kwargs)[source]
Bases:
Select2WidgetMixin
,Select2
Instanciate a widget with a URL and a list of fields to forward.
- property media
Return JS/CSS resources for the widget.
- class apis_core.apis_entities.fields.Select2Multiple(url=None, forward=None, *args, **kwargs)[source]
Bases:
Select2WidgetMixin
,Select2Multiple
Instanciate a widget with a URL and a list of fields to forward.
- property media
Return JS/CSS resources for the widget.
- class apis_core.apis_entities.fields.Select2WidgetMixin[source]
Bases:
Select2WidgetMixin
- property media
Return JS/CSS resources for the widget.
- class apis_core.apis_entities.fields.TagSelect2(url=None, forward=None, *args, **kwargs)[source]
Bases:
Select2WidgetMixin
,TagSelect2
Instanciate a widget with a URL and a list of fields to forward.
- property media
Return JS/CSS resources for the widget.
apis_core.apis_entities.filtersets module
- class apis_core.apis_entities.filtersets.AbstractEntityFilterSet(*args, **kwargs)[source]
Bases:
GenericFilterSet
- class Meta[source]
Bases:
Meta
- exclude = ['rootobject_ptr', 'self_contenttype', 'triple_set_from_subj', 'triple_set_from_obj', 'uri', 'review', 'start_date', 'start_start_date', 'start_end_date', 'end_date', 'end_start_date', 'end_end_date', 'notes', 'text', 'published', 'status', 'references']
- filter_overrides = {<class 'django.db.models.fields.CharField'>: {'extra': <function AbstractEntityFilterSet.Meta.<lambda>>, 'filter_class': <class 'django_filters.filters.CharFilter'>}}
- form
alias of
AbstractEntityFilterSetForm
- base_filters = {}
- declared_filters = {}
- class apis_core.apis_entities.filtersets.AbstractEntityFilterSetForm(*args, **kwargs)[source]
Bases:
GenericFilterSetForm
- base_fields = {}
- columns_exclude = ['rootobject_ptr', 'self_contenttype', 'triple_set_from_subj', 'triple_set_from_obj', 'uri']
- declared_fields = {}
- property media
Return all media required to render the widgets on this form.
- class apis_core.apis_entities.filtersets.ModelSearchFilter(*args, **kwargs)[source]
Bases:
CharFilter
This filter is a customized CharFilter that uses the generate_search_filter method to adapt the search filter to the model that is searched. It also extracts sets the help text based on the fields searched.
apis_core.apis_entities.forms module
apis_core.apis_entities.models module
- class apis_core.apis_entities.models.AbstractEntity(*args, **kwargs)[source]
Bases:
RootObject
Abstract super class which encapsulates common logic between the different entity kinds and provides various methods relating to either all or one specific entity kind.
Most of the class methods are designed to be used in the subclass as they are considering contexts which depend on the subclass entity type. So they are to be understood in that dynamic context.
- property get_next_id
- property get_prev_id
- rootobject_ptr
Accessor to the related object on the forward side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Restaurant.place
is aForwardOneToOneDescriptor
instance.
- rootobject_ptr_id
apis_core.apis_entities.serializers module
apis_core.apis_entities.signals module
apis_core.apis_entities.tables module
- class apis_core.apis_entities.tables.AbstractEntityTable(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:
GenericTable
- base_columns = {'delete': <apis_core.generic.tables.DeleteColumn object>, 'desc': <apis_core.generic.tables.DescriptionColumn object>, 'edit': <apis_core.generic.tables.EditColumn object>, 'noduplicate': <apis_core.apis_entities.tables.DuplicateColumn object>, 'view': <apis_core.generic.tables.ViewColumn object>}
- class apis_core.apis_entities.tables.DuplicateColumn(*args, **kwargs)[source]
Bases:
ActionColumn
A column showing a view button
- permission = 'create'
- template_name = 'columns/duplicate.html'
apis_core.apis_entities.urls module
apis_core.apis_entities.utils module
apis_core.apis_entities.views module
- class apis_core.apis_entities.views.EntitiesAutocomplete(**kwargs)[source]
Bases:
Select2QuerySetView
This endpoint allows us to use autocomplete over multiple model classes. It takes a parameter entities which is a list of ContentType natural keys and searches for the query in all instances of those entities (using generate_search_filter, which means it uses a different search approach for every model). The return values of the endpoint are then prefixed with the id of the contenttype of the results, separated by an underscore.
Example: Using this endpoint with the parameters:
?entities=apis_ontology.person&entities=apis_ontology.place&q=ammer
gives you all the persons and places that have ammer in their names and labels.
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
- class apis_core.apis_entities.views.EntitiesDuplicate(**kwargs)[source]
Bases:
GenericModelMixin
,PermissionRequiredMixin
,View
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
- permission_action_required = 'create'
- class apis_core.apis_entities.views.EntitiesMerge(**kwargs)[source]
Bases:
GenericModelMixin
,PermissionRequiredMixin
,FormView
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
- form_class
alias of
EntitiesMergeForm
- permission_action_required = 'create'
- template_name = 'entity_merge.html'
- template_name_suffix = '_merge'