shuup.simple_cms.admin_module package
Submodules
shuup.simple_cms.admin_module.form_parts module
- class shuup.simple_cms.admin_module.form_parts.CMSOpenGraphForm(*args, **kwargs)[source]
Bases:
ShuupAdminForm
- class Meta[source]
Bases:
object
- model
alias of
PageOpenGraph
- fields = ('og_type', 'title', 'description', 'section', 'tags', 'article_author', 'image')
- base_fields = {'article_author': <django.forms.fields.CharField object>, 'description': <django.forms.fields.CharField object>, 'image': <filer.fields.image.AdminImageFormField object>, 'og_type': <enumfields.forms.EnumChoiceField object>, 'section': <django.forms.fields.CharField object>, 'tags': <django.forms.fields.CharField object>, 'title': <django.forms.fields.CharField object>}
- declared_fields = {'article_author': <django.forms.fields.CharField object>, 'description': <django.forms.fields.CharField object>, 'section': <django.forms.fields.CharField object>, 'tags': <django.forms.fields.CharField object>, 'title': <django.forms.fields.CharField object>}
- property media
Return all media required to render the widgets on this form.
shuup.simple_cms.admin_module.views module
- class shuup.simple_cms.admin_module.views.PageForm(**kwargs)[source]
Bases:
MultiLanguageModelForm
- class Meta[source]
Bases:
object
- fields = ['title', 'url', 'content', 'available_from', 'available_to', 'identifier', 'visible_in_menu', 'parent', 'template_name', 'list_children_on_page', 'show_child_timestamps', 'render_title', 'available_permission_groups']
- widgets = {'content': <shuup.admin.forms.widgets.TextEditorWidget object>}
- clean()[source]
If title or content has been given on any language we must enforce that the other fields are also required in that language.
This is done the way it is because url is not required by default in model level.
- save(commit=True)[source]
Save this form’s self.instance object if commit=True. Otherwise, add a save_m2m() method to the form which can be called after the instance is saved manually at a later time. Return the model instance.
- is_url_valid(language_code, field_name, url)[source]
Ensure URL given is unique.
Check through the pages translation model objects to make sure that the url given doesn’t already exist.
Possible failure cases: * for new page: 1. URL already exists
or existing page:
URL (other than owned by existing page) exists
URL exists in other languages of existing page
- base_fields = {'available_from': <django.forms.fields.DateTimeField object>, 'available_permission_groups': <django.forms.models.ModelMultipleChoiceField object>, 'available_to': <django.forms.fields.DateTimeField object>, 'content': <django.forms.fields.CharField object>, 'identifier': <django.forms.fields.CharField object>, 'list_children_on_page': <django.forms.fields.BooleanField object>, 'parent': <mptt.forms.TreeNodeChoiceField object>, 'render_title': <django.forms.fields.BooleanField object>, 'show_child_timestamps': <django.forms.fields.BooleanField object>, 'template_name': <django.forms.fields.CharField object>, 'title': <django.forms.fields.CharField object>, 'url': <django.forms.fields.CharField object>, 'visible_in_menu': <django.forms.fields.BooleanField object>}
- declared_fields = {'available_from': <django.forms.fields.DateTimeField object>, 'available_to': <django.forms.fields.DateTimeField object>, 'content': <django.forms.fields.CharField object>, 'title': <django.forms.fields.CharField object>, 'url': <django.forms.fields.CharField object>}
- property media
Return all media required to render the widgets on this form.
- class shuup.simple_cms.admin_module.views.PageBaseFormPart(request, object=None)[source]
Bases:
FormPart
- name = 'base'
- class shuup.simple_cms.admin_module.views.PageEditView(**kwargs)[source]
Bases:
SaveFormPartsMixin
,FormPartsViewMixin
,CreateOrUpdateView
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
- template_name = 'shuup/simple_cms/admin/edit.jinja'
- base_form_part_classes: Any | Any = [<class 'shuup.simple_cms.admin_module.views.PageBaseFormPart'>]
- context_object_name = 'page'
- add_form_errors_as_messages = True
- class shuup.simple_cms.admin_module.views.PageListView[source]
Bases:
PicotableListView
- url_identifier = 'simple_cms.page'
- default_columns = [<Column: Title> title, <Column: Available since> available_from, <Column: Available until> available_to, <Column: Created by> created_by, <Column: Date created> created_on]
- get_object_abstract(instance, item)[source]
Get the object abstract lines (used for mobile layouts) for this object.
Supported keys in abstract line dicts are:
text (required)
title
class (CSS class name –
header
for instance)raw (boolean; whether or not the
text
is raw HTML)
- Parameters:
instance – The instance.
item – The item dict so far. Useful for reusing precalculated values.
- Returns:
Iterable of dicts to pass through to the picotable javascript.
- Return type:
Iterable[dict]
- class shuup.simple_cms.admin_module.views.PageDeleteView(**kwargs)[source]
Bases:
DetailView
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
- queryset
Module contents
- class shuup.simple_cms.admin_module.SimpleCMSAdminModule[source]
Bases:
AdminModule
- name = 'Content Pages'
- Return type:
- get_model_url(object, kind, shop=None)[source]
Retrieve an admin URL for the given object of the kind
kind
.A falsy value must be returned if the module does not know how to reverse the given object.
- Parameters:
object (django.db.models.Model) – A object instance (or object class).
kind (str) – URL kind. Currently “detail”, “list” or “new”.
shop (shuup.core.models.Shop|None) – The shop that owns the resource.
- Returns:
The reversed URL or none.
- Return type:
str|None