Skip to content

Reusable Components

amplifi edited this page Jun 29, 2017 · 1 revision

SchemaSelectorMixin

The SchemaSelectorMixin reusable component provides a queryable interface for project attributes. The JSONATTRS_SCHEMA_SELECTORS setting is inspected and for each content_type a dictionary of Attributes is built. If a particular domain entity does not have any conditional attribute selectors the attributes will be stored as follows:

{
    spatial.spatialunit: {'DEFAULT': [Attribute, Attribute, ...]}
}

For content types that have conditional selector fields defined, eg party type, the dictionary will be structured as follows:

{
    party.party: {
                    'IN': [Attribute, Attribute, ...],
                    'GR': [Attribute, Attribute, ...],
                    'CO': [Attribute, Attribute, ...]
                 }
}

This allows attributes for a particular content type to be returned either as default attributes or for the possible values for conditonal attributes.

Clone this wiki locally