ox.apps.core

Core application libraries.

ox.apps.core.apps

Oxylus application inherits from AppConfig. It allows to:

  • handle assets;

  • provide application metadata;

  • application level permission;

We plan to use those metadata and dependencies in order to automate loading and ease application installation by end-users.

class ox.apps.core.apps.CoreAppConfig(*args, **kwargs)[source]

Bases: AppConfig

icon: str = 'mdi-weather-sunny'

Material design icon class.

npm_package: str | None = '@oxylus/core'

Name of the corresponding NPM package to look up for.

Defaults to app label.

ready()[source]

Override this method in subclasses to run code when Django starts.

root_url: str = 'ox/core'

Provide an alternative to app label when we target application in paths.

For example Oxylus will nest template directories as ox/core/ instead of ox_core. The same happens for urls.

ox.apps.core.management

ox.apps.core.serializers

class ox.apps.core.serializers.GroupSerializer(*args, **kwargs)[source]

Bases: ModelSerializer

class ox.apps.core.serializers.PasswordLoginSerializer(*args, **kwargs)[source]

Bases: Serializer

class ox.apps.core.serializers.PasswordSerializer(*args, **kwargs)[source]

Bases: Serializer

class ox.apps.core.serializers.PermissionSerializer(*args, **kwargs)[source]

Bases: ModelSerializer

class ox.apps.core.serializers.UserSerializer(*args, **kwargs)[source]

Bases: ModelSerializer

ox.apps.core.signals

ox.apps.core.signals.create_app_groups(sender, app_config, *args, **kwargs)[source]

This creates users groups for applications.

ox.apps.core.templatetags

ox.apps.core.templatetags.ox

ox.apps.core.templatetags.ox.do_json(value)[source]

Dumps value as json string.

Return type:

str

ox.apps.core.templatetags.ox.do_startswith(text, search)[source]

Return True when provided text start with search.

Return type:

bool

ox.apps.core.templatetags.ox.panel_url(urlname, panel, view=None, section_or_id=None, id=None)[source]

Return url to this panel.

Parameters:
  • urlname (str) – url name

  • panel (str) – panel name

  • view (str | None) – target view

  • section_or_id (str | int | None) – section name (when id is provided) or id

  • id (str | int | None) – target object id

Return type:

str

ox.apps.core.views

class ox.apps.core.views.AccountView(**kwargs)[source]

Bases: AppView

app_config_name: str | None = 'ox_core'

AppConfig name of the related application.

If none provided, retrieve it based of request’s resolver match.

title: str = 'My Account'

Application title (as displayed in <title> and top bar).

class ox.apps.core.views.AccountViewSet(**kwargs)[source]

Bases: LoginMixin, GenericViewSet

credentials_serializer_class

alias of PasswordLoginSerializer

serializer_class

alias of UserSerializer

class ox.apps.core.views.ConfViewSet(**kwargs)[source]

Bases: ViewSet

class ox.apps.core.views.ContentTypeViewSet(**kwargs)[source]

Bases: ReadOnlyModelViewSet

serializer_class

alias of ContentTypeSerializer

class ox.apps.core.views.DashboardView(**kwargs)[source]

Bases: LoginRequiredMixin, AppView

app_config_name: str | None = 'ox_core'

AppConfig name of the related application.

If none provided, retrieve it based of request’s resolver match.

title: str = 'Dashboard'

Application title (as displayed in <title> and top bar).

class ox.apps.core.views.ErrorView(**kwargs)[source]

Bases: AppView

title: str = 'An error occurred'

Application title (as displayed in <title> and top bar).

class ox.apps.core.views.GroupViewSet(**kwargs)[source]

Bases: ModelViewSet

serializer_class

alias of GroupSerializer

class ox.apps.core.views.InternalErrorView(**kwargs)[source]

Bases: ErrorView

title: str = 'Internal server error'

Application title (as displayed in <title> and top bar).

class ox.apps.core.views.LoginView(**kwargs)[source]

Bases: LoginMixin, AppView

app_config_name: str | None = 'ox_core'

AppConfig name of the related application.

If none provided, retrieve it based of request’s resolver match.

class ox.apps.core.views.LogoutView(**kwargs)[source]

Bases: RedirectView

class ox.apps.core.views.PermissionForbiddenView(**kwargs)[source]

Bases: ErrorView

title: str = 'Permission forbidden'

Application title (as displayed in <title> and top bar).

class ox.apps.core.views.PermissionViewSet(**kwargs)[source]

Bases: ModelViewSet

serializer_class

alias of PermissionSerializer

class ox.apps.core.views.SettingsView(**kwargs)[source]

Bases: LoginRequiredMixin, AppView

class ox.apps.core.views.UserViewSet(**kwargs)[source]

Bases: ModelViewSet

serializer_class

alias of UserSerializer