core.utils

Submodules

Package Contents

Functions

utcNow()

Returns an actual timestamp with UTC timezone setting.

seoUrlToEntry(module[, entry, skelType, language])

Return the seo-url to a skeleton instance or the module.

seoUrlToFunction(module, function[, render])

normalizeKey(key)

Normalizes a datastore key (replacing _application with the current one)

__getattr__(attr)

Attributes

__UTILS_CONF_REPLACEMENT

__UTILS_NAME_REPLACEMENT

core.utils.utcNow()

Returns an actual timestamp with UTC timezone setting.

Return type:

datetime.datetime

core.utils.seoUrlToEntry(module, entry=None, skelType=None, language=None)

Return the seo-url to a skeleton instance or the module.

Parameters:
  • module (str) – The module name.

  • entry (Optional[SkeletonInstance]) – A skeleton instance or None, to get the path to the module.

  • skelType (Optional[str]) – # FIXME: Not used

  • language (Optional[str]) – For which language. If None, the language of the current request is used.

Returns:

The path (with a leading /).

Return type:

str

core.utils.seoUrlToFunction(module, function, render=None)
Parameters:
  • module (str) –

  • function (str) –

  • render (Optional[str]) –

Return type:

str

core.utils.normalizeKey(key)

Normalizes a datastore key (replacing _application with the current one)

Parameters:

key (Union[None, viur.core.db.KeyClass]) – Key to be normalized.

Returns:

Normalized key in string representation.

Return type:

Union[None, viur.core.db.KeyClass]

core.utils.__UTILS_CONF_REPLACEMENT
core.utils.__UTILS_NAME_REPLACEMENT
core.utils.__getattr__(attr)