cms.core.plugins package

Submodules

cms.core.plugins.admin module

class cms.core.plugins.admin.SettingsAppAdmin(model, admin_site)

Bases: django.contrib.admin.options.ModelAdmin

Admin class for settings model. Redirect add/change views to the list view where a single form is rendered for editing all settings.

change_list_template = 'admin/core/plugins/settings/change_list.html'
changelist_redirect()
changelist_view(*args, **kwargs)
get_urls()
has_change_permission(request, obj=None)
media

cms.core.plugins.apps module

class cms.core.plugins.apps.CorePluginsConfig(app_name, app_module)

Bases: django.apps.config.AppConfig

name = 'cms.core.plugins'
ready()

cms.core.plugins.context_processors module

cms.core.plugins.context_processors.settings(request)

Add the settings object to the template context.

cms.core.plugins.forms module

class cms.core.plugins.forms.SettingsAppForm(*args, **kwargs)

Bases: django.forms.forms.Form

Form for settings - creates a field for each setting in cms.*models*.*Settings that is marked as editable.

base_fields = OrderedDict()
declared_fields = OrderedDict()
get_fields(setting_title, setting)
media
save()

cms.core.plugins.managers module

class cms.core.plugins.managers.PluginManager

Bases: django.db.models.manager.Manager

get_query_set(*args, **kwargs)
get_queryset()

cms.core.plugins.models module

class cms.core.plugins.models.Plugin(id)

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception Plugin.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

Plugin.objects = <cms.core.plugins.managers.PluginManager object at 0x33db350>
class cms.core.plugins.models.Setting(*args, **kwargs)

Bases: cms.core.models.BaseData

Stores values for cms.core.plugins that can be edited via the admin.

class ApiPrivate
fields = ('app', 'content_type', 'object_pk', 'model', 'site', 'title', 'value')
exception Setting.DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception Setting.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

Setting.content_object

Provides a generic relation to any object through content-type/object-id fields.

Setting.content_type
Setting.created_by
Setting.get_next_by_created_date(*moreargs, **morekwargs)
Setting.get_next_by_modified_date(*moreargs, **morekwargs)
Setting.get_previous_by_created_date(*moreargs, **morekwargs)
Setting.get_previous_by_modified_date(*moreargs, **morekwargs)
Setting.modified_by
Setting.objects = <django.db.models.manager.Manager object at 0x3cedd50>
Setting.save(*args, **kwargs)

Set the site to the current site.

Setting.site

cms.core.plugins.utils module

cms.core.plugins.utils.add_file_to_dict(staticfiles_dict, staticfiles_key, staticfiles_path, staticfile, prefix, site_type, mode, device=None, log=False)
cms.core.plugins.utils.build_class(model, module, app_label)
cms.core.plugins.utils.get_staticfiles(plugin, staticfiles_dict)
cms.core.plugins.utils.get_staticfiles_for_admin(files, prefix, staticfiles_path, staticfiles_dict)
cms.core.plugins.utils.get_staticfiles_for_apps(files, app, prefix, staticfiles_path, staticfiles_dict)
cms.core.plugins.utils.get_staticfiles_for_cmsplugin(plugin, prefix, staticfiles_path, staticfiles_dict)
cms.core.plugins.utils.get_staticfiles_theme(staticfiles_dict, settings)

Module contents

class cms.core.plugins.CMSPluginBase

Bases: object

admin_icon_class = None
author = 'inMeta.Networks'
author_mail = 'support@inmeta.net'
author_www = 'https://www.inmeta.net/'
static copyright(author)
description = 'Package description.'
description_long = None
get_defaults_setting(key)
get_excludes()
get_includes()
get_media(app_label)
get_models_defs()
get_templates()
license = 'Simplified BSD'
register()
set_type()
staticfiles = {'admin': {'fonts': [], 'css': [], 'js': []}, 'site': {'default': {'fonts': [], 'css': [], 'js': []}, 'mobile': {'fonts': [], 'css': [], 'js': []}, 'tablet': {'fonts': [], 'css': [], 'js': []}}}
staticfiles_ondemand = {'admin': {'fonts': [], 'css': [], 'js': []}, 'site': {'default': {'fonts': [], 'css': [], 'js': []}, 'mobile': {'fonts': [], 'css': [], 'js': []}, 'tablet': {'fonts': [], 'css': [], 'js': []}}}
status = 'alpha'
verbose_name = None
version = '0.1'
exception cms.core.plugins.CMSPluginException

Bases: exceptions.Exception

class cms.core.plugins.Settings

Bases: object

An object that provides settings via dynamic attribute access. Settings that are registered as editable and can therefore be stored in the database are all loaded once only, the first time any editable setting is accessed. When accessing uneditable settings their default values are used. The Settings object also provides access to Django settings via django.conf.settings in order to provide a consistent method of access for all settings.

use_editable(model=None)

Empty the editable settings cache and set the loaded flag to False so that settings will be loaded from the DB on next access. If the conf app is not installed then set the loaded flag to True in order to bypass DB lookup entirely.

cms.core.plugins.patch_settings()

Merge settings with global cms settings, so all required attributes will exist. Never override, just append non existing settings.

Also check for setting inconstistence if settings.DEBUG