core

iii

iii

iii

vvv iii uu uu rrrrrrrr

vvvv iii uu uu rr rr

v vvvv iii uu uu rr rr vv vvvv iii uu uu rr rrrrr

vvvv vvvv iii uu uu rr rrr
vvv vvvv iii uu uu rr rrr
vvvvvv iii uu uu rr rrr

vvvv iii uuuuuu rr rrr

I N F O R M A T I O N S Y S T E M

ViUR core Copyright 2022 by Mausbrand Informationssysteme GmbH

ViUR is a free software development framework for the Google App Engine™. More about ViUR can be found at https://www.viur.dev.

Licensed under the GNU Lesser General Public License, version 3. See file LICENSE for more information.

Subpackages

Submodules

Package Contents

Functions

setDefaultLanguage(lang: str)

Sets the default language used by ViUR to lang.

setDefaultDomainLanguage(domain: str, lang: str)

If conf["viur.languageMethod"] is set to "domain", this function allows setting the map of which domain

mapModule(moduleObj: object, moduleName: str, targetResolverRender: dict)

Maps each function that's exposed of moduleObj into the branch of prop:viur.core.conf["viur.mainResolver"]

buildApp(modules: Union[types.ModuleType, object], renderers: Union[types.ModuleType, Dict], default: str = None)

Creates the application-context for the current instance.

setup(modules: Union[object, types.ModuleType], render: Union[types.ModuleType, Dict] = None, default: str = 'html')

Define whats going to be served by this instance.

app(environ: dict, start_response: Callable)

forceSSL(f: Callable) → Callable

Decorator, which forces usage of an encrypted Channel for a given resource.

forcePost(f: Callable) → Callable

Decorator, which forces usage of an http post request.

exposed(f: Union[Callable, dict]) → Callable

Decorator, which marks an function as exposed.

internalExposed(f: Callable) → Callable

Decorator, marks an function as internal exposed.

core.setDefaultLanguage(lang: str)

Sets the default language used by ViUR to lang.

Parameters

lang – Name of the language module to use by default.

core.setDefaultDomainLanguage(domain: str, lang: str)

If conf[“viur.languageMethod”] is set to “domain”, this function allows setting the map of which domain should use which language. :param domain: The domain for which the language should be set :param lang: The language to use (in ISO2 format, e.g. “DE”)

core.mapModule(moduleObj: object, moduleName: str, targetResolverRender: dict)

Maps each function that’s exposed of moduleObj into the branch of prop:viur.core.conf[“viur.mainResolver”] that’s referenced by prop:targetResolverRender. Will also walk prop:_viurMapSubmodules if set and map these sub-modules also.

core.buildApp(modules: Union[types.ModuleType, object], renderers: Union[types.ModuleType, Dict], default: str = None)

Creates the application-context for the current instance.

This function converts the classes found in the modules-module, and the given renders into the object found at conf["viur.mainApp"].

Every class found in modules becomes

  • instanced

  • get the corresponding renderer attached

  • will be attached to conf["viur.mainApp"]

Parameters
  • modules – Usually the module provided as modules directory within the application.

  • renderers – Usually the module viur.core.renders, or a dictionary renderName => renderClass.

  • default – Name of the renderer, which will form the root of the application. This will be the renderer, which wont get a prefix, usually html. (=> /user instead of /html/user)

core.setup(modules: Union[object, types.ModuleType], render: Union[types.ModuleType, Dict] = None, default: str = 'html')

Define whats going to be served by this instance.

Parameters
  • modules – Usually the module provided as modules directory within the application.

  • render – Usually the module viur.core.renders, or a dictionary renderName => renderClass.

  • default – Name of the renderer, which will form the root of the application. This will be the renderer, which wont get a prefix, usually html. (=> /user instead of /html/user)

core.app(environ: dict, start_response: Callable)
core.forceSSL(f: Callable) Callable

Decorator, which forces usage of an encrypted Channel for a given resource. Has no effect on development-servers.

core.forcePost(f: Callable) Callable

Decorator, which forces usage of an http post request.

core.exposed(f: Union[Callable, dict]) Callable

Decorator, which marks an function as exposed.

Only exposed functions are callable by http-requests. Can optionally receive a dict of language->translated name to make that function available under different names

core.internalExposed(f: Callable) Callable

Decorator, marks an function as internal exposed.

Internal exposed functions are not callable by external http-requests, but can be called by templates using execRequest().