core.prototypes.skelmodule

Module Contents

Classes

SkelModule

This is the extended module prototype used by any other ViUR module prototype.

Functions

__load_indexes_from_file()

Loads all indexes from the index.yaml and stores it in a dictionary sorted by the module(kind)

Attributes

SINGLE_ORDER_TYPE

Type for exactly one sort order definitions.

ORDER_TYPE

Type for sort order definitions (any amount of single order definitions).

DEFAULT_ORDER_TYPE

Type for default sort order definitions.

DATASTORE_INDEXES

core.prototypes.skelmodule.SINGLE_ORDER_TYPE

Type for exactly one sort order definitions.

core.prototypes.skelmodule.ORDER_TYPE

Type for sort order definitions (any amount of single order definitions).

core.prototypes.skelmodule.DEFAULT_ORDER_TYPE

Type for default sort order definitions.

core.prototypes.skelmodule.__load_indexes_from_file()

Loads all indexes from the index.yaml and stores it in a dictionary sorted by the module(kind) :return A dictionary of indexes per module

Return type:

dict[str, list]

core.prototypes.skelmodule.DATASTORE_INDEXES
class core.prototypes.skelmodule.SkelModule(*args, **kwargs)

Bases: viur.core.Module

This is the extended module prototype used by any other ViUR module prototype. It a prototype which generally is bound to some database model abstracted by the ViUR skeleton system.

kindName: str

Name of the datastore kind that is handled by this module.

This information is used to bind a specific viur.core.skeleton.Skeleton-class to this prototype. By default, it is automatically determined from the module’s class name, so a module named Animal refers to a Skeleton named AnimalSkel and its kindName is animal.

For more information, refer to the function _resolveSkelCls().

_resolveSkelCls(*args, **kwargs)

Retrieve the generally associated viur.core.skeleton.Skeleton that is used by the application.

This is either be defined by the member variable kindName or by a Skeleton named like the application class in lower-case order.

If this behavior is not wanted, it can be definitely overridden by defining module-specific viewSkel(), addSkel(), or editSkel() functions, or by overriding this function in general.

Returns:

Returns a Skeleton class that matches the application.

Return type:

Type[viur.core.skeleton.Skeleton]

baseSkel(*args, **kwargs)

Returns an instance of an unmodified base skeleton for this module.

This function should only be used in cases where a full, unmodified skeleton of the module is required, e.g. for administrative or maintenance purposes.

By default, baseSkel is used by viewSkel(), addSkel(), and editSkel().

Return type:

viur.core.skeleton.SkeletonInstance