cms.core package

Subpackages

Submodules

cms.core.admin module

class cms.core.admin.CSMRedirectAdmin(model, admin_site)

Bases: cms.contrib.admin.admin.CMSAdmin, django.contrib.redirects.admin.RedirectAdmin

autocomplete_lookup_fields = {'fk': ['site']}
media
radio_fields = {}
raw_id_fields = ('site',)
class cms.core.admin.CSMSiteAdmin(model, admin_site)

Bases: cms.contrib.admin.admin.CMSAdmin, django.contrib.sites.admin.SiteAdmin

media
class cms.core.admin.ContentAdmin(model, admin_site)

Bases: cms.core.admin.DisplayableAdmin

Admin class for subclasses of the abstract Content model.

fields_with_sibling = ('description', 'image', 'teaser', 'imageteaser')
fieldset_content = ((<django.utils.functional.__proxy__ object at 0x5582610>, {'fields': ['image', 'imagedescription', 'content', 'imageteaser', 'imageteaserdescription', 'teaser', 'teaser_auto']}),)
fieldset_settings = ((<django.utils.functional.__proxy__ object at 0x5582750>, {'fields': [('login_required', 'sitemapped'), ('license', 'schema')]}),)
fieldsets = ((<django.utils.functional.__proxy__ object at 0x557edd0>, {'fields': ['title', ('status', 'mark'), ('published_date', 'expired_date')]}), (<django.utils.functional.__proxy__ object at 0x5582610>, {'fields': ['image', 'imagedescription', 'content', 'imageteaser', 'imageteaserdescription', 'teaser', 'teaser_auto']}), (<django.utils.functional.__proxy__ object at 0x5582350>, {'fields': ['keywords']}), (<django.utils.functional.__proxy__ object at 0x5582750>, {'fields': [('login_required', 'sitemapped'), ('license', 'schema')]}), (<django.utils.functional.__proxy__ object at 0x5582490>, {'fields': ['slug', 'description', 'description_auto', 'author', 'sites']}))
formfield_for_foreignkey(db_field, request, **kwargs)
get_title(obj)
media
search_fields = ('title', 'description', 'keywords__keyword__title', 'content')
class cms.core.admin.CoreAdminNotification

Bases: cms.contrib.admin.admin.AdminNotification

get_context(request)
level = 'danger'
perms = ('is_staff',)
class cms.core.admin.DisplayableAdmin(model, admin_site)

Bases: cms.contrib.admin.admin.CMSAdmin, cms.core.admin.OwnableAdmin, cms.contrib.keywords.admin.KeywordableAdmin, cms.core.translations.admin.TranslationAdmin

Admin class for subclasses of the abstract Displayable model.

autocomplete_lookup_fields = {'generic': [], 'm2m': ['sites'], 'fk': ['author']}
date_hierarchy = 'published_date'
fields_with_sibling = ('description',)
fieldsets = ((<django.utils.functional.__proxy__ object at 0x557edd0>, {'fields': ['title', ('status', 'mark'), ('published_date', 'expired_date')]}), (<django.utils.functional.__proxy__ object at 0x5582350>, {'fields': ['keywords']}), (<django.utils.functional.__proxy__ object at 0x5582450>, {'fields': [('login_required', 'sitemapped')]}), (<django.utils.functional.__proxy__ object at 0x5582490>, {'fields': ['slug', 'description', 'description_auto', 'author', 'sites']}))
get_published_date(obj)
get_published_date_exact = True
get_title(obj)
list_display = ('get_published_date', 'get_title')
list_display_meta = ('status', 'login_required')
list_filter = ('published_date', 'status', 'login_required', 'keywords__keyword')
list_stats_queryset_by = ('published_date',)
media
prepopulated_fields = {'slug': ('title',)}
raw_id_fields = ('author', 'sites')
search_fields = ('title', 'description', 'keywords__keyword__title')
class cms.core.admin.OrderableAdmin(model, admin_site)

Bases: cms.contrib.admin.admin.CMSAdmin

class Media
extra = ''
js = ['//127.0.0.1:8080/static/cms/js/admin/core.listorder.js']
url = 'core.listorder.js'
OrderableAdmin.list_editable = ('order',)
OrderableAdmin.media
class cms.core.admin.OrderableInline

Bases: object

Mixin which hides the sortable field with Stacked and Tabular inlines. This mixin must precede admin.TabularInline or admin.StackedInline.

sortable_field_name = 'order'
class cms.core.admin.OrderableManyToManyAdmin(model, admin_site)

Bases: cms.contrib.admin.admin.CMSAdmin

count_items(obj)
media
class cms.core.admin.OrderableSelfAdmin(model, admin_site)

Bases: cms.contrib.admin.admin.CMSAdmin

class Media
extra = ''
js = ['//127.0.0.1:8080/static/cms/js/admin/core.listorder.js']
url = 'core.listorder.js'
OrderableSelfAdmin.changelist_view(request, extra_context=None)
OrderableSelfAdmin.count_children(obj)
OrderableSelfAdmin.get_parent(obj)
OrderableSelfAdmin.list_editable = ('order',)
OrderableSelfAdmin.media
class cms.core.admin.OwnableAdmin(model, admin_site)

Bases: django.contrib.admin.options.ModelAdmin

Admin class for models that subclass the abstract Ownable model. Handles limiting the change list to objects owned by the logged in user, as well as setting the owner of newly created objects to the logged in user.

get_changeform_initial_data(request)

Get the initial form data. Unless overridden, this populates from the GET params.

get_queryset(request)

Filter the changelist qs by currently logged in user if not a superuser.

list_filter_append = (<class 'cms.core.filters.OwnableListFilter'>,)
media
queryset(*args, **kwargs)
save_form(request, form, change)

Set the object’s owner as the logged in user.

class cms.core.admin.OwnableInline

Bases: object

foreignkey_author_fields = ('author',)
formfield_for_foreignkey(db_field, request, **kwargs)

cms.core.cms_checks module

class cms.core.cms_checks.CMSChecks(fail_silently=False)

Bases: cms.utils.cms_check.CMSChecksBase

check()

cms.core.cms_defaults module

cms.core.cms_plugin module

class cms.core.cms_plugin.CMSPlugin

Bases: cms.core.plugins.CMSPluginBase

admin_icon_class = 'icon-pstriangle'
description = <django.utils.functional.__proxy__ object at 0x48762d0>
staticfiles = {'site': {'default': {'fonts': ['webhostinghub-glyphs.eot', 'webhostinghub-glyphs.svg', 'webhostinghub-glyphs.ttf'], 'css': ['core.style.css', 'core.errors.css', 'core.forms.css', 'core.label-badgets.css', 'core.links.css', 'core.pit.css', 'core.pit.syntax-highlighted.css', 'core.socialshare.css', 'core.tables.css', 'core.wysihtml5.css', 'contrib.messages.css', 'contrib.protoshow.css', 'contrib.shadowbox.css', 'ui.buttons.css', 'ui.dropdown.css', 'ui.icons.css', 'ui.tabs.css', 'ui.tooltip.css'], 'js': ['lib/prototype.js', 'lib/scriptaculous.js', 'lib/scriptaculous.builder.js', 'lib/scriptaculous.effetcs.js', 'lib/scriptaculous.controls.js', 'lib/scriptaculous.slider.js', 'lib/livepipe.js', 'lib/livepipe.cookie.js', 'lib/livepipe.scrollbar.js', 'lib/livepipe.tabs.js', 'lib/growler.js', 'lib/protoshow.js', 'lib/opentip.js', 'lib/shadowbox.js', 'lib/wysihtml5x-toolbar.js', 'core.js', 'core.patch.js', 'apps.js', 'ui.js', 'ui.dropdown.js', 'ui.input.js', 'ui.navpanel.js', 'ui.reveal.js', 'ui.scrollto.js', 'ui.switchradio.js', 'ui.toggleteaser.js', 'ui.tools.js', 'ui.tooltip.js', 'contrib.js', 'contrib.admin.js', 'contrib.forms.js', 'contrib.forms.check.js', 'contrib.messages.js', 'contrib.passwords.js', 'contrib.protoshow.js', 'contrib.shadowbox.js', 'contrib.wysihtml5.js']}}}
staticfiles_ondemand = {'site': {'default': {'css': [{'files': ('cms/css/site/default/errors/core.maintenance.css',), 'name': 'core.maintenance'}, {'files': ('cms/css/site/default/contrib.leaflet.css', 'cms/css/site/default/contrib.leaflet.markers.css'), 'name': 'contrib.leaflet'}, {'files': ('cms/css/site/default/contrib.leaflet.markercluster.css',), 'name': 'contrib.leaflet.markercluster'}], 'js': [{'files': ('cms/js/site/default/lib/leaflet.js', 'cms/js/site/default/lib/leaflet.markers.js', 'cms/js/site/default/lib/leaflet.providers.js', 'cms/js/site/default/contrib.leaflet.js'), 'name': 'contrib.leaflet'}, {'files': ('cms/js/site/default/lib/leaflet.markercluster.js', 'cms/js/site/default/contrib.leaflet.markercluster.js'), 'name': 'contrib.leaflet.markercluster'}]}}}
status = 'stable'
verbose_name = <django.utils.functional.__proxy__ object at 0x4876350>
version = '0.7'

cms.core.context_processors module

cms.core.context_processors.base(request)

push usefull stuff into context

cms.core.decorators module

cms.core.decorators.superuser_only(function)

Limit view to superusers only.

cms.core.decorators.xrobots_none(view_fn)
class ArticlesBaseView(GenericTemplateView):

@method_decorator(xrobots_none) def dispatch(self, *args, **kwargs):

return super(ArticlesBaseView, self).dispatch(*args, **kwargs)
cms.core.decorators.xrobots_tag(rule='none')
class ArticlesBaseView(GenericTemplateView):

@method_decorator(xrobots_tag(rule=’noindex, noimageindex’)) def dispatch(self, *args, **kwargs):

return super(ArticlesBaseView, self).dispatch(*args, **kwargs)

cms.core.fields module

class cms.core.fields.AutoCreatedField(*args, **kwargs)

Bases: django.db.models.fields.DateTimeField

A DateTimeField that automatically populates itself at object creation.

pre_save(model_instance, add)
class cms.core.fields.AutoLastModifiedField(*args, **kwargs)

Bases: cms.core.fields.AutoCreatedField

A DateTimeField that updates itself on each save() of the model.

pre_save(model_instance, add)
class cms.core.fields.BaseGenericRelation(*args, **kwargs)

Bases: django.contrib.contenttypes.fields.GenericRelation

Extends GenericRelation to: - Add a consistent default value for object_id_field and

check for a default_related_model attribute which can be defined on subclasses as a default for the to argument.
  • Add one or more custom fields to the model that the relation field is applied to, and then call a related_items_changed method each time related items are saved or deleted, so that a calculated value can be stored against the custom fields since aggregates aren’t available for GenericRelation instances.
contribute_to_class(cls, name)

Add each of the names and fields in the fields attribute to the model the relationship field is applied to, and set up the related item save and delete signals for calling related_items_changed.

fields = {}
related_items_changed(instance, related_manager)

Can be implemented by subclasses - called whenever the state of related items change, eg they’re saved or deleted. The instance for this field and the related manager for the field are passed as arguments.

value_from_object(obj)

Returns the value of this field in the given model instance. Needed for Django 1.7: https://code.djangoproject.com/ticket/22552

class cms.core.fields.ChoicesInheritanceCharField(*args, **kwargs)

Bases: django.db.models.fields.CharField

A CharField that looks for a choices class-attribute and automatically uses that as choices.

Also features a no_check_for_status argument to make sure South can handle this field when it freezes a model.

contribute_to_class(cls, name)
deconstruct()
prepare_class(sender, **kwargs)
class cms.core.fields.ChoicesInheritanceIntegerField(*args, **kwargs)

Bases: django.db.models.fields.IntegerField

A CharField that looks for a choices class-attribute and automatically uses that as choices.

Also features a no_check_for_status argument to make sure South can handle this field when it freezes a model.

contribute_to_class(cls, name)
deconstruct()
prepare_class(sender, **kwargs)
class cms.core.fields.FileField(*args, **kwargs)

Bases: filebrowser.fields.FileBrowseField

contribute_to_class(cls, name)
formfield(**kwargs)

call directory for dynmaic paths

get_prep_value(value)

Check also for unicode - we need this for cms.core.translations

class cms.core.fields.GeopositionField(*args, **kwargs)

Bases: django.db.models.fields.Field

A geoposition field (latitude and longitude and path)

contribute_to_class(cls, name)
description = 'A geoposition (latitude and longitude)'
formfield(**kwargs)
get_internal_type()
get_prep_value(value)
to_python(value)
value_to_string(obj)
class cms.core.fields.IntegerRangeField(verbose_name=None, name=None, min_value=None, max_value=None, **kwargs)

Bases: django.db.models.fields.IntegerField

formfield(**kwargs)
class cms.core.fields.OrderedManyToManyField(to, ordered=True, **kwargs)

Bases: django.db.models.fields.related.ManyToManyField

Providing a many to many relation that remembers the order of related objects.

Accept a boolean ordered attribute which specifies if relation is ordered or not. Default is set to True. If ordered is set to False the field will behave exactly like django’s ManyToManyField.

contribute_to_class(cls, name)
create_intermediate_model(klass)
create_intermediate_model_from_attrs(klass, attrs)
deconstruct()
formfield(**kwargs)
get_foreignkey_field_kwargs()
get_intermediate_model_from_field(klass)
get_intermediate_model_meta_class(klass, from_field_name, to_field_name, order_value_field_name)
get_intermediate_model_name(klass)
get_intermediate_model_order_value_field(klass)
get_intermediate_model_to_field(klass)
get_internal_type()
get_rel_to_model_and_object_name(klass)
class cms.core.fields.PickledObject

Bases: str

A subclass of string so it can be told whether a string is a pickled object or not (if the object is an instance of this class then it must [well, should] be a pickled one).

Only really useful for passing pre-encoded values to default with dbsafe_encode, not that doing so is necessary. If you remove PickledObject and its references, you won’t be able to pass in pre-encoded values anymore, but you can always just pass in the python objects themselves.

class cms.core.fields.PickledObjectField(*args, **kwargs)

Bases: django.db.models.fields.Field

A field that will accept any python object and store it in the database. PickledObjectField will optionally compress its values if declared with the keyword argument compress=True.

Does not actually encode and compress None objects (although you can still do lookups using None). This way, it is still possible to use the isnull lookup type correctly.

contribute_to_class(cls, name)
get_db_prep_lookup(lookup_type, value, connection=None, prepared=False)
get_db_prep_value(value, connection=None, prepared=False)

Pickle and b64encode the object, optionally compressing it.

The pickling protocol is specified explicitly (by default 2), rather than as -1 or HIGHEST_PROTOCOL, because we don’t want the protocol to change over time. If it did, exact and in lookups would likely fail, since pickle would now be generating a different string.

get_default()

Returns the default value for this field.

The default implementation on models.Field calls force_unicode on the default, which means you can’t set arbitrary Python objects as the default. To fix this, we just return the value without calling force_unicode on it. Note that if you set a callable as a default, the field will still call it. It will not try to pickle and encode it.

get_internal_type()
pre_save(model_instance, add)
to_python(value)

B64decode and unpickle the object, optionally decompressing it.

If an error is raised in de-pickling and we’re sure the value is a definite pickle, the error is allowed to propogate. If we aren’t sure if the value is a pickle or not, then we catch the error and return the original value instead.

value_to_string(obj)
class cms.core.fields.ReverseOrderedManyRelatedObjectsDescriptor(m2m_field)

Bases: django.db.models.fields.related.ReverseManyRelatedObjectsDescriptor

related_manager_cls
class cms.core.fields.RichTextBaseField(*args, **kwargs)

Bases: django.db.models.fields.TextField

formfield(**kwargs)
class cms.core.fields.RichTextContentField(*args, **kwargs)

Bases: cms.core.fields.RichTextBaseField

clean(value, model_instance, language=None)
class cms.core.fields.RichTextTeaserField(*args, **kwargs)

Bases: cms.core.fields.RichTextBaseField

formfield(**kwargs)
class cms.core.fields.SitesField(to, db_constraint=True, swappable=True, **kwargs)

Bases: django.db.models.fields.related.ManyToManyField

A ManyToManyField that automatically populates itself at object creation.

formfield(**kwargs)
save_form_data(instance, data)
class cms.core.fields.SlugField(*args, **kwargs)

Bases: django.db.models.fields.SlugField

formfield(**kwargs)
is_sloppy = False
is_url = False
class cms.core.fields.TemplateField(*args, **kwargs)

Bases: django.db.models.fields.CharField

formfield(**kwargs)
validate(value, model_instance)

Validates value and throws ValidationError. Subclasses should override this to provide validation logic.

class cms.core.fields.WriteableBinaryField(*args, **kwargs)

Bases: django.db.models.fields.BinaryField

cms.core.fields.dbsafe_decode(value, compress_object=False)
cms.core.fields.dbsafe_encode(value, compress_object=False, pickle_protocol=2)
cms.core.fields.wrap_conflictual_object(obj)

cms.core.filters module

class cms.core.filters.OwnableListFilter(request, params, model, model_admin)

Bases: cms.contrib.accounts.filters.AccountsAccountStaffListFilter

parameter_name = 'author'
queryset(request, queryset)
title = <django.utils.functional.__proxy__ object at 0x557ee50>

cms.core.finders module

class cms.core.finders.AppMediaDirectoriesFinder(app_names=None, *args, **kwargs)

Bases: django.contrib.staticfiles.finders.AppDirectoriesFinder

source_dir = 'media'
cms.core.finders.get_media_finders()

cms.core.forms module

class cms.core.forms.CMSSecurityBaseForm

Bases: object

Handles the security aspects (anti-spoofing) for contact forms.

generate_formhash()
generate_secrutiy_fields()
generate_security_data()

Generate a dict of security data for ‘initial’ data.

generate_security_hash(timestamp)

Generate a HMAC security hash from the timestamp.

initial_security_hash(timestamp)

Generate the initial security hash from a (unix) timestamp.

security_errors()

Return just those errors associated with security

security_fields = []
class cms.core.forms.CMSSecurityForm(*args, **kwargs)

Bases: cms.core.forms.CMSSecurityBaseForm, django.forms.forms.Form

base_fields = OrderedDict()
declared_fields = OrderedDict()
media
class cms.core.forms.CMSSecurityModelForm(*args, **kwargs)

Bases: cms.core.forms.CMSSecurityBaseForm, django.forms.models.ModelForm

base_fields = OrderedDict()
declared_fields = OrderedDict()
media
class cms.core.forms.GeopositionFormField(*args, **kwargs)

Bases: django.forms.fields.MultiValueField

compress(value_list)
default_error_messages = {'invalid': <django.utils.functional.__proxy__ object at 0x3588490>}
widget_attrs(widget)
class cms.core.forms.OrderedManyToManyField(*args, **kwargs)

Bases: django.forms.models.ModelMultipleChoiceField

clean(value)
label_from_instance(obj)

This method is used to convert objects into strings; it’s used to generate the labels for the choices presented by this object. Subclasses can override this method to customize the display of the choices.

widget

alias of OrderedManyToManyWidget

class cms.core.forms.RichTextFormField(config_name='default', config_extra={}, *args, **kwargs)

Bases: django.forms.fields.CharField

class cms.core.forms.RichTextFormTeaserField(config_name='teaser', config_extra={}, *args, **kwargs)

Bases: django.forms.fields.CharField

class cms.core.forms.SlugField(max_length=None, min_length=None, placeholder=None, jsvalidate=None, *args, **kwargs)

Bases: django.forms.fields.CharField

default_error_messages = {'invalid': <django.utils.functional.__proxy__ object at 0x35884d0>}
default_validators = [<cms.core.validators.base.SloppySlugValidator object at 0x37034d0>]
class cms.core.forms.URLField(max_length=None, min_length=None, *args, **kwargs)

Bases: django.forms.fields.CharField

default_error_messages = {'invalid': <django.utils.functional.__proxy__ object at 0x3703590>}
to_python(value)

cms.core.helpers module

class cms.core.helpers.Breadcrumbs(request, **kwargs)

Bases: object

Helper for building context meta object

breadcrumbs
template = u'<span itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a itemprop="item" href="{url}" title="{title}"><span itemprop="name">{title}</span></a><meta itemprop="position" content="{position}" /></span>'
template_text = u'<span itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><span itemprop="item"><span itemprop="name">{title}</span></span><meta itemprop="position" content="{position}" /></span>'
class cms.core.helpers.Metadata(request, view)

Bases: object

Helper for building context meta object

get_extra()
get_keywords()
get_og()
get_twitter()
keywords
parse_object(request, obj)
title
title_as_list
title_delimiter = u' \u25cb '
update_og(obj)
update_twitter(obj)
cms.core.helpers.build_generic_tag(name, value)
cms.core.helpers.build_og_tag(name, value)
cms.core.helpers.build_twitter_tag(name, value)

cms.core.http module

class cms.core.http.HttpResponseServiceUnavailable(content='', *args, **kwargs)

Bases: django.http.response.HttpResponse

status_code = 503
class cms.core.http.SecurityPostBadRequest(content)

Bases: django.http.response.HttpResponseBadRequest

cms.core.managers module

class cms.core.managers.CleanupManager(days=30, fieldname='created_date')

Bases: django.db.models.manager.Manager

The CleanupManager used to delete expired records from the database.

Use it in your model-class: class LoggerLog(Content):

cleanup_expired = CleanupManager(days=60)
delete_expired()
get_expired()
class cms.core.managers.ContentManager

Bases: cms.core.managers.DisplayableManager

Manually combines CurrentSiteManager, PublishedManager for the Displayable model.

published_deferred(fields=None, **kwargs)
class cms.core.managers.DisplayableManager

Bases: cms.core.managers.PublishedManager

Manually combines CurrentSiteManager, PublishedManager for the Displayable model.

filter(*args, **kwargs)

We need this to set language dynamically for example ajax-request

skip_lang = False
class cms.core.managers.InheritanceManager

Bases: cms.core.managers.InheritanceManagerMixin, django.db.models.manager.Manager

class cms.core.managers.InheritanceManagerMixin

Bases: object

get_query_set(*args, **kwargs)
get_queryset()
get_subclass(*args, **kwargs)
select_subclasses(*subclasses)
class cms.core.managers.PublishedManager

Bases: django.db.models.manager.Manager

Provides filter for restricting items returned by status and publish date when the given user is not a staff member.

get_by_natural_key(slug)
get_model_translated_fields()
model_translated_fields
published(**kwargs)

For non-staff users, return items with a published status and whose publish and expiry dates fall before and after the current date when specified. We need this to set language dynamically for example ajax-request.

We attach query_bypass_cachalot to the query class of the returned queryset because we have to tell cachalot to skip the caching of this query. It’s useless because of the datetime filter. cms.core.cache.monkeypatch is required. TODO: find a better solution

cms.core.messages module

cms.core.models module

class cms.core.models.BaseData(*args, **kwargs)

Bases: django.db.models.base.Model

A abstract class that provides base-data of an object.

class ApiPrivate
fields = ('created_date', 'created_by', 'get_absolute_admin_url', 'modified_date', 'modified_by', 'pk')
class BaseData.ApiPublic
enabled = False
fields = ('created_date', 'modified_date', 'pk')
class BaseData.Meta
abstract = False
get_latest_by = 'modified_date'
ordering = ('created_date',)
class BaseData.Settings
BaseData.created_by
BaseData.created_date_since()

Returns the time since created_date.

BaseData.get_absolute_admin_url()

returns a admin-url for this object

BaseData.get_cache_key(items=(), pk=None, lang=False)
BaseData.get_next_by_created_date(*moreargs, **morekwargs)
BaseData.get_next_by_modified_date(*moreargs, **morekwargs)
BaseData.get_original(*args, **kwargs)
BaseData.get_previous_by_created_date(*moreargs, **morekwargs)
BaseData.get_previous_by_modified_date(*moreargs, **morekwargs)
BaseData.get_settings()
BaseData.get_translated_fields()
BaseData.get_translated_fields_for_field(field)
BaseData.get_verbose_name_plural_raw()

Returns the version untranslated of verbose_name_plural.

BaseData.has_changed(field)
BaseData.is_in_update_fields(fields, **kwargs)

returns a rendered edit-in-admin-link for this object

BaseData.modified_by
BaseData.modified_date_since()

Returns the time since modified_date.

BaseData.settings
BaseData.translated_fields
BaseData.verbose_name_plural_raw

Returns the version untranslated of verbose_name_plural.

class cms.core.models.CMSInitializeBase

Bases: object

iter_models()
models = ()
now_fields = ('created_date', 'modified_date', 'published_date')
now_fields_skip = {}
set_now(obj)
class cms.core.models.Commentable(*args, **kwargs)

Bases: django.db.models.base.Model

Abstract model that provides comments for an object.

class ApiPrivate
fields = ('comments_allow', 'comments_close', 'comments_count')
class Commentable.ApiPublic
fields = ('comments_allow', 'comments_close', 'comments_count')
class Commentable.Meta
abstract = False
class Commentable.Translation
fields = ('comments_count',)
Commentable.comments

This class provides the functionality that makes the related-object managers available as attributes on a model class, for fields that have multiple “remote” values and have a GenericRelation defined in their model (rather than having another model pointed at them). In the example “article.publications”, the publications attribute is a ReverseGenericRelatedObjectsDescriptor instance.

class cms.core.models.Content(*args, **kwargs)

Bases: cms.core.models.Displayable

Provides a Rich Text field for managing general content.

class ApiPrivate
fields = ('content', 'image', 'imagedescription', 'imageteaser', 'imageteaserdescription', 'license', 'schema', 'teaser', 'word_count')
serializer_class = 'cms.core.api.rest.serializers.ApiRestContentModelSerializer'
class Content.ApiPublic
fields = ('content', 'image', 'imagedescription', 'imageteaser', 'imageteaserdescription', 'license', 'schema', 'teaser', 'word_count')
serializer_class = 'cms.core.api.rest.serializers.ApiRestContentModelSerializer'
class Content.Meta
abstract = False
Content.SCHEMA_CHOICES = [('CreativeWork', <django.utils.functional.__proxy__ object at 0x3bc3d50>), ('Answer', <django.utils.functional.__proxy__ object at 0x3bc3dd0>), ('Article', <django.utils.functional.__proxy__ object at 0x3bc3e50>), ('Blog', <django.utils.functional.__proxy__ object at 0x3bc3ed0>), ('BlogPosting', <django.utils.functional.__proxy__ object at 0x3bc3f50>), ('Book', <django.utils.functional.__proxy__ object at 0x3bc3fd0>), ('Clip', <django.utils.functional.__proxy__ object at 0x3bc8090>), ('Code', <django.utils.functional.__proxy__ object at 0x3bc8110>), ('Comment', <django.utils.functional.__proxy__ object at 0x3bc8190>), ('DataCatalog', <django.utils.functional.__proxy__ object at 0x3bc8210>), ('Dataset', <django.utils.functional.__proxy__ object at 0x3bc8290>), ('Diet', <django.utils.functional.__proxy__ object at 0x3bc8310>), ('EmailMessage', <django.utils.functional.__proxy__ object at 0x3bc8390>), ('Episode', <django.utils.functional.__proxy__ object at 0x3bc8410>), ('ExercisePlan', <django.utils.functional.__proxy__ object at 0x3bc8490>), ('ImageGallery', <django.utils.functional.__proxy__ object at 0x3bc8510>), ('ItemList', <django.utils.functional.__proxy__ object at 0x3bc8590>), ('Map', <django.utils.functional.__proxy__ object at 0x3bc8610>), ('MediaObject', <django.utils.functional.__proxy__ object at 0x3bc8690>), ('Movie', <django.utils.functional.__proxy__ object at 0x3bc8710>), ('MusicPlaylist', <django.utils.functional.__proxy__ object at 0x3bc8790>), ('MusicRecording', <django.utils.functional.__proxy__ object at 0x3bc8810>), ('NewsArticle', <django.utils.functional.__proxy__ object at 0x3bc8890>), ('Painting', <django.utils.functional.__proxy__ object at 0x3bc8910>), ('Photograph', <django.utils.functional.__proxy__ object at 0x3bc8990>), ('Question', <django.utils.functional.__proxy__ object at 0x3bc8a10>), ('Recipe', <django.utils.functional.__proxy__ object at 0x3bc8a90>), ('Review', <django.utils.functional.__proxy__ object at 0x3bc8b10>), ('Sculpture', <django.utils.functional.__proxy__ object at 0x3bc8b90>), ('Season', <django.utils.functional.__proxy__ object at 0x3bc8c10>), ('Series', <django.utils.functional.__proxy__ object at 0x3bc8c90>), ('SoftwareApplication', <django.utils.functional.__proxy__ object at 0x3bc8d10>), ('TVSeason', <django.utils.functional.__proxy__ object at 0x3bc8d90>), ('TVSeries', <django.utils.functional.__proxy__ object at 0x3bc8e10>), ('WebSite', <django.utils.functional.__proxy__ object at 0x3bc8e90>), ('WebPage', <django.utils.functional.__proxy__ object at 0x3bc8f10>), ('WebPageElement', <django.utils.functional.__proxy__ object at 0x3bc8f90>), ('AboutPage', <django.utils.functional.__proxy__ object at 0x3bc9050>), ('CheckoutPage', <django.utils.functional.__proxy__ object at 0x3bc90d0>), ('CollectionPage', <django.utils.functional.__proxy__ object at 0x3bc9150>), ('ContactPage', <django.utils.functional.__proxy__ object at 0x3bc91d0>), ('ItemPage', <django.utils.functional.__proxy__ object at 0x3bc9250>), ('MedicalWebPage', <django.utils.functional.__proxy__ object at 0x3bc92d0>), ('ProfilePage', <django.utils.functional.__proxy__ object at 0x3bc9350>), ('QAPage', <django.utils.functional.__proxy__ object at 0x3bc93d0>), ('SearchResultsPage', <django.utils.functional.__proxy__ object at 0x3bc9450>)]
class Content.Translation
fields = ('content', 'teaser', 'image', 'imagedescription', 'imageteaser', 'imageteaserdescription')
Content.created_by
Content.get_css_classes()
Content.get_image_absolute_url(request, version=None, prepend_proto=True)
Content.get_image_css()
Content.get_imageteaser
Content.get_imageteaserdescription

Find all links in the content of this item. When a link is encountered, this will attempt to discover the title of the page it links to. If there is a problem with the target page, or there is no title (ie it’s an image or other binary file), the text of the link is used as the title. Once a title is determined, it is cached for a week before it will be requested again.

Content.get_mark_display(*moreargs, **morekwargs)
Content.get_next_by_created_date(*moreargs, **morekwargs)
Content.get_next_by_modified_date(*moreargs, **morekwargs)
Content.get_next_by_published_date(*moreargs, **morekwargs)
Content.get_previous_by_created_date(*moreargs, **morekwargs)
Content.get_previous_by_modified_date(*moreargs, **morekwargs)
Content.get_previous_by_published_date(*moreargs, **morekwargs)
Content.get_schema
Content.get_schema_display(*moreargs, **morekwargs)
Content.get_status_display(*moreargs, **morekwargs)
Content.get_teaser(**kwargs)
Content.image

A placeholder class that provides a way to set the attribute on the model.

Content.image_upload_to(instance)
Content.imageteaser

A placeholder class that provides a way to set the attribute on the model.

Content.keywords

This class provides the functionality that makes the related-object managers available as attributes on a model class, for fields that have multiple “remote” values and have a GenericRelation defined in their model (rather than having another model pointed at them). In the example “article.publications”, the publications attribute is a ReverseGenericRelatedObjectsDescriptor instance.

Content.license

Find all links in the content of this item. When a link is encountered, this will attempt to discover the title of the page it links to. If there is a problem with the target page, or there is no title (ie it’s an image or other binary file), the text of the link is used as the title. Once a title is determined, it is cached for a week before it will be requested again.

Content.modified_by
Content.save(*args, **kwargs)
Content.sites
Content.word_count

Stupid word counter for content.

class cms.core.models.Core(*args, **kwargs)

Bases: django.db.models.base.Model

A class that holds site-settings.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception Core.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

class Core.Settings
LICENSE = {'default': '18'}
Core.objects = <django.db.models.manager.Manager object at 0x3bcfbd0>
class cms.core.models.Displayable(*args, **kwargs)

Bases: cms.core.models.BaseData, cms.core.models.SiteData, cms.core.models.MetaData, cms.core.models.Slugged

Abstract model that provides features of a visible page on the website such as publishing fields.

class ApiPrivate
fields = ('expired_date', 'mark', 'html_app_id', 'html_object_id', 'is_published', 'pubdate', 'published_date', 'status', 'sitemapped')
class Displayable.ApiPublic
fields = ('expired_date', 'mark', 'html_app_id', 'html_object_id', 'is_published', 'pubdate', 'published_date', 'status', 'sitemapped')
Displayable.MARK_CHOICES = (('update', <django.utils.functional.__proxy__ object at 0x3bd3990>), ('important', <django.utils.functional.__proxy__ object at 0x3bd39d0>), ('soon', <django.utils.functional.__proxy__ object at 0x3bd3a10>))
Displayable.MARK_IMPORTANT = 'important'
Displayable.MARK_SOON = 'soon'
Displayable.MARK_UPDATE = 'update'
class Displayable.Meta
abstract = False
Displayable.SCHEMA_CHOICES = [('CreativeWork', <django.utils.functional.__proxy__ object at 0x3bc3d50>), ('Answer', <django.utils.functional.__proxy__ object at 0x3bc3dd0>), ('Article', <django.utils.functional.__proxy__ object at 0x3bc3e50>), ('Blog', <django.utils.functional.__proxy__ object at 0x3bc3ed0>), ('BlogPosting', <django.utils.functional.__proxy__ object at 0x3bc3f50>), ('Book', <django.utils.functional.__proxy__ object at 0x3bc3fd0>), ('Clip', <django.utils.functional.__proxy__ object at 0x3bc8090>), ('Code', <django.utils.functional.__proxy__ object at 0x3bc8110>), ('Comment', <django.utils.functional.__proxy__ object at 0x3bc8190>), ('DataCatalog', <django.utils.functional.__proxy__ object at 0x3bc8210>), ('Dataset', <django.utils.functional.__proxy__ object at 0x3bc8290>), ('Diet', <django.utils.functional.__proxy__ object at 0x3bc8310>), ('EmailMessage', <django.utils.functional.__proxy__ object at 0x3bc8390>), ('Episode', <django.utils.functional.__proxy__ object at 0x3bc8410>), ('ExercisePlan', <django.utils.functional.__proxy__ object at 0x3bc8490>), ('ImageGallery', <django.utils.functional.__proxy__ object at 0x3bc8510>), ('ItemList', <django.utils.functional.__proxy__ object at 0x3bc8590>), ('Map', <django.utils.functional.__proxy__ object at 0x3bc8610>), ('MediaObject', <django.utils.functional.__proxy__ object at 0x3bc8690>), ('Movie', <django.utils.functional.__proxy__ object at 0x3bc8710>), ('MusicPlaylist', <django.utils.functional.__proxy__ object at 0x3bc8790>), ('MusicRecording', <django.utils.functional.__proxy__ object at 0x3bc8810>), ('NewsArticle', <django.utils.functional.__proxy__ object at 0x3bc8890>), ('Painting', <django.utils.functional.__proxy__ object at 0x3bc8910>), ('Photograph', <django.utils.functional.__proxy__ object at 0x3bc8990>), ('Question', <django.utils.functional.__proxy__ object at 0x3bc8a10>), ('Recipe', <django.utils.functional.__proxy__ object at 0x3bc8a90>), ('Review', <django.utils.functional.__proxy__ object at 0x3bc8b10>), ('Sculpture', <django.utils.functional.__proxy__ object at 0x3bc8b90>), ('Season', <django.utils.functional.__proxy__ object at 0x3bc8c10>), ('Series', <django.utils.functional.__proxy__ object at 0x3bc8c90>), ('SoftwareApplication', <django.utils.functional.__proxy__ object at 0x3bc8d10>), ('TVSeason', <django.utils.functional.__proxy__ object at 0x3bc8d90>), ('TVSeries', <django.utils.functional.__proxy__ object at 0x3bc8e10>), ('WebSite', <django.utils.functional.__proxy__ object at 0x3bc8e90>), ('WebPage', <django.utils.functional.__proxy__ object at 0x3bc8f10>), ('WebPageElement', <django.utils.functional.__proxy__ object at 0x3bc8f90>), ('AboutPage', <django.utils.functional.__proxy__ object at 0x3bc9050>), ('CheckoutPage', <django.utils.functional.__proxy__ object at 0x3bc90d0>), ('CollectionPage', <django.utils.functional.__proxy__ object at 0x3bc9150>), ('ContactPage', <django.utils.functional.__proxy__ object at 0x3bc91d0>), ('ItemPage', <django.utils.functional.__proxy__ object at 0x3bc9250>), ('MedicalWebPage', <django.utils.functional.__proxy__ object at 0x3bc92d0>), ('ProfilePage', <django.utils.functional.__proxy__ object at 0x3bc9350>), ('QAPage', <django.utils.functional.__proxy__ object at 0x3bc93d0>), ('SearchResultsPage', <django.utils.functional.__proxy__ object at 0x3bc9450>)]
Displayable.STATUS_CHOICES = ((1, <django.utils.functional.__proxy__ object at 0x3bd3a50>), (2, <django.utils.functional.__proxy__ object at 0x3bd3a90>), (3, <django.utils.functional.__proxy__ object at 0x3bd3ad0>), (4, <django.utils.functional.__proxy__ object at 0x3bd3b10>))
Displayable.STATUS_DISCARDED = 4
Displayable.STATUS_DRAFT = 2
Displayable.STATUS_PUBLISHED = 1
Displayable.STATUS_READYFORREVIEW = 3
static Displayable.autocomplete_search_fields()
Displayable.clean()
Displayable.created_by
Displayable.expire_in()
Displayable.expired_date_since()

Returns the time since expired_date.

Displayable.get_css_classes()
Displayable.get_mark_display(*moreargs, **morekwargs)
Displayable.get_next_by_created_date(*moreargs, **morekwargs)
Displayable.get_next_by_modified_date(*moreargs, **morekwargs)
Displayable.get_next_by_published_date(*moreargs, **morekwargs)
Displayable.get_previous_by_created_date(*moreargs, **morekwargs)
Displayable.get_previous_by_modified_date(*moreargs, **morekwargs)
Displayable.get_previous_by_published_date(*moreargs, **morekwargs)
Displayable.get_status_boolean_icon
Displayable.get_status_display(*moreargs, **morekwargs)
Displayable.html_app_id
Displayable.html_object_id
Displayable.is_editable(request)

Restrict editing to the objects’s owner and superusers.

Displayable.is_published
Displayable.keywords

This class provides the functionality that makes the related-object managers available as attributes on a model class, for fields that have multiple “remote” values and have a GenericRelation defined in their model (rather than having another model pointed at them). In the example “article.publications”, the publications attribute is a ReverseGenericRelatedObjectsDescriptor instance.

Displayable.modified_by
Displayable.pubdate
Displayable.published_date_since()

Returns the time since published_date.

Displayable.related_label()
Displayable.sites
class cms.core.models.Location(*args, **kwargs)

Bases: django.db.models.base.Model

class ApiPrivate
fields = ('city', 'country', 'email', 'fax', 'phone', 'position', 'state', 'street', 'url', 'zipcode')
class Location.ApiPublic
fields = ('city', 'country', 'email', 'fax', 'phone', 'position', 'state', 'street', 'url', 'zipcode')
class Location.Meta
abstract = False
class Location.Translation
fields = ('email', 'url')
Location.get_address
Location.get_country_display(*moreargs, **morekwargs)
Location.position

A placeholder class that provides a way to set the attribute on the model.

class cms.core.models.MetaData(*args, **kwargs)

Bases: django.db.models.base.Model

Abstract model that provides meta data for content.

class ApiPrivate
fields = ('description', 'description_auto', 'keywords_string')
class MetaData.ApiPublic
fields = ('description', 'description_auto', 'keywords_string')
class MetaData.Meta
abstract = False
class MetaData.Translation
fields = ('description', 'keywords_string')
MetaData.get_description(**kwargs)
MetaData.keywords

This class provides the functionality that makes the related-object managers available as attributes on a model class, for fields that have multiple “remote” values and have a GenericRelation defined in their model (rather than having another model pointed at them). In the example “article.publications”, the publications attribute is a ReverseGenericRelatedObjectsDescriptor instance.

MetaData.save(*args, **kwargs)
class cms.core.models.Orderable(*args, **kwargs)

Bases: django.db.models.base.Model

Abstract model that provides a custom ordering integer field similar to using Meta’s order_with_respect_to, since to date (Django 1.2) this doesn’t work with ForeignKey('self'), or with Generic Relations. We may also want this feature for models that aren’t ordered with respect to a particular field.

class ApiPrivate
fields = ('order',)
class Orderable.ApiPublic
fields = ('order',)
class Orderable.Meta
abstract = False
ordering = ('order',)
Orderable.delete(*args, **kwargs)

Update the ordering values for siblings.

Orderable.get_next_by_order(**kwargs)

Retrieves next object by order.

Orderable.get_previous_by_order(**kwargs)

Retrieves previous object by order.

Orderable.save(*args, **kwargs)

Set the initial ordering value.

Orderable.with_respect_to()

Returns a dict to use as a filter for ordering operations containing the original Meta.order_with_respect_to value if provided. If the field is a Generic Relation, the dict returned contains names and values for looking up the relation’s ct_field and fk_field attributes.

class cms.core.models.OrderableBase

Bases: django.db.models.base.ModelBase

Checks for order_with_respect_to on the model’s inner Meta class and if found, copies it to a custom attribute and deletes it since it will cause errors when used with ForeignKey('self'). Also creates the ordering attribute on the Meta class if not yet provided.

class cms.core.models.OrderableSelf(*args, **kwargs)

Bases: django.db.models.base.Model

An abstract model that allows objects to be ordered relative to each other. Provides an order field.

class ApiPrivate
fields = ('level', 'order')
class OrderableSelf.ApiPublic
fields = ('level', 'order')
class OrderableSelf.Meta
abstract = False
ordering = ('order',)
OrderableSelf.clean()
OrderableSelf.parent_children
OrderableSelf.parent_childrens
OrderableSelf.parent_has_children
OrderableSelf.parents
OrderableSelf.save(*args, **kwargs)
class cms.core.models.Ownable(*args, **kwargs)

Bases: django.db.models.base.Model

Abstract model that provides ownership of an object for a user.

class ApiPrivate
fields = ('author',)
class Ownable.Meta
abstract = False
Ownable.author
class cms.core.models.Person(*args, **kwargs)

Bases: django.db.models.base.Model

Abstract model that provides a person.

class ApiPrivate
fields = ('birthday', 'email', 'first_name', 'gender', 'language', 'last_name', 'meta_facebook', 'meta_google', 'meta_icq', 'meta_jabber', 'meta_skype', 'meta_twitter', 'meta_url', 'name_nick', 'name_middle', 'name_prefix', 'name_suffix', 'age', 'name')
Person.GENDER_BOTH = 3
Person.GENDER_CHOICES = ((1, <django.utils.functional.__proxy__ object at 0x3bed090>), (2, <django.utils.functional.__proxy__ object at 0x3bed110>), (3, <django.utils.functional.__proxy__ object at 0x3bed150>), (4, <django.utils.functional.__proxy__ object at 0x3bed190>))
Person.GENDER_FEMALE = 1
Person.GENDER_MALE = 2
Person.GENDER_NONSPECIFIC = 4
class Person.Meta
abstract = False
Person.SENSITIVE_DATA = ('birthday', 'gender')
Person.age
Person.get_full_name()

Returns the first_name plus the last_name, with a space in between.

Person.get_gender_display(*moreargs, **morekwargs)
Person.get_language_display(*moreargs, **morekwargs)
Person.get_short_name()

Returns the short name for the user.

Person.name

Returns the first_name plus the last_name, with a space in between.

Person.sensitive_data
Person.vcard()

Returns a vObject of thecContact

class cms.core.models.Ratable(*args, **kwargs)

Bases: django.db.models.base.Model

Abstract model that provides ratings for an object.

class ApiPrivate
fields = ('ratings_allow', 'ratings_average', 'ratings_count', 'ratings_sum')
class Ratable.ApiPublic
fields = ('ratings_allow', 'ratings_average', 'ratings_count', 'ratings_sum')
class Ratable.Meta
abstract = False
Ratable.ratings

This class provides the functionality that makes the related-object managers available as attributes on a model class, for fields that have multiple “remote” values and have a GenericRelation defined in their model (rather than having another model pointed at them). In the example “article.publications”, the publications attribute is a ReverseGenericRelatedObjectsDescriptor instance.

class cms.core.models.Siblings(*args, **kwargs)

Bases: django.db.models.base.Model

class Meta
abstract = False
Siblings.get_next(filterkwargs=None, only=None, prefetch=None, select=None)

Determines the next item

Siblings.get_previous(filterkwargs=None, only=None, prefetch=None, select=None)

Determines the previous item

class cms.core.models.SiteData(*args, **kwargs)

Bases: django.db.models.base.Model

class ApiPrivate
fields = ('sites', 'login_required')
class SiteData.Meta
abstract = False
SiteData.sites
class cms.core.models.Slugged(*args, **kwargs)

Bases: django.db.models.base.Model

Abstract model that handles auto-generating slugs. Each slugged object is also affiliated with a specific site object.

class ApiPrivate
fields = ('title', 'slug')
class Slugged.ApiPublic
fields = ('title', 'slug')
class Slugged.Meta
abstract = False
ordering = ('title',)
class Slugged.Translation
fields = ('title', 'slug')
Slugged.get_slug(**kwargs)

Please be aware if you have datetime fields. Convert to utc: _localtime = self.published_date.astimezone(utc)!

Slugged.get_unique_slug(slug, lang)
Slugged.save(*args, **kwargs)

Create a unique slug by appending an index. Set the site to the current site when the record is first created, unless the update_site argument is explicitly set to True.

cms.core.models.site_autocomplete_search_fields

staticmethod(function) -> method

Convert a function to be a static method.

A static method does not receive an implicit first argument. To declare a static method, use this idiom:

class C: def f(arg1, arg2, ...): ... f = staticmethod(f)

It can be called either on the class (e.g. C.f()) or on an instance (e.g. C().f()). The instance is ignored except for its class.

Static methods in Python are similar to those found in Java or C++. For a more advanced concept, see the classmethod builtin.

cms.core.monkeypatch module

cms.core.monkeypatch.patch_charfield_init(self, max_length=None, min_length=None, placeholder=None, jsvalidate=None, *args, **kwargs)
cms.core.monkeypatch.patch_charfield_widget_attrs(self, widget, *args, **kwargs)

This function is for use on the CharField class.

cms.core.monkeypatch.patch_field_widget_attrs(self, widget)

This function is for use on the base Field class.

cms.core.monkeypatch.patch_url(regex, view, kwargs=None, name=None, prefix='')

patch django.conf import urls to also use SSL = True in app’s urls.py for our SSLRedirectMiddleware. We don’t want set {‘SSL’: True} for every url...

cms.core.operations module

class cms.core.operations.AlterOrderedManyToManyField(model_name, name, field, preserve_default=True)

Bases: django.db.migrations.operations.fields.AlterField

A migration operation to transform a ManyToManyField into a OrderedManyToManyField and vice versa.

add_order_value_field(schema_editor, model)
database_backwards(app_label, schema_editor, from_state, to_state)
database_forwards(app_label, schema_editor, from_state, to_state)
make_order_by_field(model)
remove_order_value_field(schema_editor, model)
cms.core.operations.get_apps_from_state(migration_state)
cms.core.operations.get_field(model, field_name)

cms.core.query module

class cms.core.query.InheritanceQuerySet(model=None, query=None, using=None, hints=None)

Bases: cms.core.query.InheritanceQuerySetMixin, django.db.models.query.QuerySet

class cms.core.query.InheritanceQuerySetMixin

Bases: object

annotate(*args, **kwargs)
get_subclass(*args, **kwargs)
iterator()
select_subclasses(*subclasses)
class cms.core.query.QuerySetChain(*subquerysets)

Bases: object

Chains multiple subquerysets (possibly of different models) and behaves as one queryset. Supports minimal methods needed for use with django.core.paginator.

count()

Performs a .count() for all subquerysets and returns the number of records as an integer.

cms.core.routers module

class cms.core.routers.DatabaseAppsRouter

Bases: object

A router to control all database operations on models for different databases.

In case an app is not set in settings.DATABASE_APPS_ROUTER_MAPPING, the router will fallback to the default database.

Settings example:

DATABASE_APPS_ROUTER_MAPPING = {‘app1’: ‘db1’, ‘app2’: ‘db2’}

allow_relation(obj1, obj2, **hints)

Allow any relation between apps that use the same database.

allow_syncdb(db, model)

Make sure that apps only appear in the related database.

db_for_read(model, **hints)

“Point all read operations to the specific database.

db_for_write(model, **hints)

Point all write operations to the specific database.

cms.core.storage module

class cms.core.storage.BuildFilesStorage(location=None, base_url=None, *args, **kwargs)

Bases: django.contrib.staticfiles.storage.ManifestStaticFilesStorage

A build file system storage backend which also saves hashed copies of the files it saves.

get_path_for_combined(name, device, mode)
url_combined(name, device, mode, force=False)

Returns the URL from staticfiles storage in DEBUG mode since we want all single files. In Production we need the combined and builded file this storage.

class cms.core.storage.MediaFilesStorage(location=None, base_url=None, *args, **kwargs)

Bases: django.core.files.storage.FileSystemStorage

Standard file system storage for static media files.

The defaults for location and base_url are MEDIA_ROOT and MEDIA_URL.

cms.core.urls module

cms.core.utils module

class cms.core.utils.Geoposition(latitude, longitude)

Bases: object

cms.core.utils.generate_content_title(obj)
cms.core.utils.get_content_help_text(instance)
cms.core.utils.get_teaser_help_text(instance)

cms.core.views module

class cms.core.views.GenericCSRFProtectedTemplateView(**kwargs)

Bases: cms.core.views.GenericTemplateView

dispatch(*args, **kwargs)
class cms.core.views.GenericCSRFProtectedView(**kwargs)

Bases: cms.core.views.GenericView

dispatch(*args, **kwargs)
class cms.core.views.GenericLoginCSRFProtectedTemplateView(**kwargs)

Bases: cms.core.views.GenericTemplateView

dispatch(*args, **kwargs)
class cms.core.views.GenericLoginCSRFProtectedView(**kwargs)

Bases: django.views.generic.base.View

dispatch(*args, **kwargs)
class cms.core.views.GenericLoginProtectedTemplateView(**kwargs)

Bases: cms.core.views.GenericTemplateView

dispatch(*args, **kwargs)
class cms.core.views.GenericSuperuserOnlyTemplateView(**kwargs)

Bases: cms.core.views.GenericTemplateView

dispatch(*args, **kwargs)
class cms.core.views.GenericSuperuserOnlyView(**kwargs)

Bases: cms.core.views.GenericView

dispatch(*args, **kwargs)
class cms.core.views.GenericTemplateTooltipView(**kwargs)

Bases: django.views.generic.base.TemplateView

post(*args, **kwargs)
class cms.core.views.GenericTemplateView(**kwargs)

Bases: django.views.generic.base.TemplateView

breadcrumbs_class

alias of Breadcrumbs

empty_response()
empty_response_on_bad_request()
get_available_languages(attr_list)
get_breadcrumb_class(request)
get_context_data(request, **kwargs)
get_metadata_class(request)
get_template_names()

Returns a list of template names to be used for the request. Must return a list. May not be called if render_to_response is overridden.

Modified to add template_name.local.html to an alternative to overextend template tag. Just place template_name.local.html in cms_local and extend the original.

langs_available(attr_list)
language
metadata_class

alias of Metadata

schema_body = None
schema_main = None
security_error(errors)
class cms.core.views.GenericView(**kwargs)

Bases: django.views.generic.base.View

empty_response()
empty_response_on_bad_request()
language
security_error(errors)
class cms.core.views.HomeView(**kwargs)

Bases: cms.core.views.GenericTemplateView

get(request, *args, **kwargs)
template_name = 'home.html'
class cms.core.views.MaintenanceView(**kwargs)

Bases: cms.core.views.GenericTemplateView

get(request, *args, **kwargs)
template_name = 'errors/maintenance.html'
class cms.core.views.RobotsView(**kwargs)

Bases: cms.core.views.GenericTemplateView

get(request, *args, **kwargs)
render_to_response(context, **kwargs)
template_name = 'robots.txt'
cms.core.views.error_400(request, *args, **kwargs)
cms.core.views.error_403(request, *args, **kwargs)
cms.core.views.error_404(request, *args, **kwargs)
cms.core.views.error_500(request, *args, **kwargs)
cms.core.views.error_503(request, *args, **kwargs)
cms.core.views.get_errors_context(request, status_code)
cms.core.views.javascript_catalog(request, domain='djangojs', packages=None)

Returns the selected language catalog as a javascript library.

Receives the list of packages to check for translations in the packages parameter either from an infodict or as a +-delimited string from the request. Default is ‘django.conf’.

Additionally you can override the gettext domain for this view, but usually you don’t want to do that, as JavaScript messages go to the djangojs domain. But this might be needed if you deliver your JavaScript source from Django templates.

cms.core.views.render_javascript_catalog(catalog=None, plural=None)

cms.core.widgets module

class cms.core.widgets.ClearableFileInput(attrs=None)

Bases: django.forms.widgets.ClearableFileInput

media
render(name, value, attrs=None)
class cms.core.widgets.FileInput(attrs=None)

Bases: cms.core.widgets.Input

input_type = 'file'
media
class cms.core.widgets.GeopositionLabeledTextInput(*args, **kwargs)

Bases: django.forms.widgets.TextInput

media
render(name, value, attrs=None)
class cms.core.widgets.GeopositionWidget(attrs=None)

Bases: django.forms.widgets.MultiWidget

class Media
css = {'all': ['//127.0.0.1:8080/static/cms/css/admin/core.geoposition.css']}
css_all = ('core.geoposition.css',)
extra = ''
js = ['//127.0.0.1:8080/static/cms/js/admin/core.geoposition.js', '//maps.googleapis.com/maps/api/js']
url = 'core.geoposition.js'
GeopositionWidget.decompress(value)
GeopositionWidget.format_output(rendered_widgets)
GeopositionWidget.media
class cms.core.widgets.Input(attrs=None)

Bases: django.forms.widgets.Input

Base class for all <input> widgets (except type=’checkbox’ and type=’radio’, which are special).

media
render(name, value, attrs=None)
class cms.core.widgets.ListField2SelectMultiple(attrs=None, choices=())

Bases: django.forms.widgets.SelectMultiple

media
render(name, value, attrs=None, choices=())
class cms.core.widgets.ListField2Textarea(attrs=None)

Bases: django.forms.widgets.Widget

media
render(name, values, attrs=None)
class cms.core.widgets.OrderedManyToManyWidget(*args, **kwargs)

Bases: django.forms.widgets.CheckboxSelectMultiple

class Media
css = {'all': ['//127.0.0.1:8080/static/cms/css/admin/core.orderedmanytomany.css']}
css_all = ('core.orderedmanytomany.css',)
extra = ''
js = ['//127.0.0.1:8080/static/cms/js/admin/core.orderedmanytomany.js']
url = 'core.orderedmanytomany.js'
OrderedManyToManyWidget.build_attrs(attrs=None, **kwargs)
OrderedManyToManyWidget.media
OrderedManyToManyWidget.render(name, value, attrs=None, choices=())
OrderedManyToManyWidget.value_from_datadict(data, files, name)
class cms.core.widgets.RichTextWidget(config_name='default', config_extra={}, *args, **kwargs)

Bases: django.forms.widgets.Textarea

Widget providing CKEditor for Rich Text Editing. Supports direct image uploads and embed.

class Media
js = ('cms/lib/ckeditor/ckeditor.js',)
RichTextWidget.media
RichTextWidget.render(name, value, attrs={})
class cms.core.widgets.Select(attrs=None, choices=())

Bases: django.forms.widgets.Select

media
render(name, value, attrs=None, choices=())
class cms.core.widgets.Switch(attrs=None, check_test=None)

Bases: django.forms.widgets.CheckboxInput

media
render(name, value, attrs=None)
class cms.core.widgets.TextInput(attrs=None)

Bases: cms.core.widgets.Input

input_type = 'text'
media
class cms.core.widgets.TextareaWYSI(attrs=None)

Bases: django.forms.widgets.Widget

media
render(name, value, attrs=None)
cms.core.widgets.is_required(w)

Module contents