shuup.simple_cms.admin_module package¶
Submodules¶
shuup.simple_cms.admin_module.views module¶
-
class
shuup.simple_cms.admin_module.views.
PageForm
(**kwargs)[source]¶ Bases:
shuup.utils.multilanguage_model_form.MultiLanguageModelForm
-
class
Meta
[source]¶ Bases:
object
-
model
¶ alias of
Page
-
fields
= ['title', 'url', 'content', 'available_from', 'available_to', 'identifier', 'visible_in_menu', 'parent', 'list_children_on_page']¶
-
widgets
= {'content': <shuup.admin.forms.widgets.TextEditorWidget object at 0x7fabc76b8b70>}¶
-
-
PageForm.
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.
-
PageForm.
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: * URL already exists
for existing page: * URL (other than owned by existing page) exists * URL exists in other languages of existing page
-
PageForm.
base_fields
= OrderedDict([('title', <django.forms.fields.CharField object at 0x7fabc75930b8>), ('url', <django.forms.fields.CharField object at 0x7fabc7593358>), ('content', <django.forms.fields.CharField object at 0x7fabc7593278>), ('available_from', <django.forms.fields.DateTimeField object at 0x7fabc75797f0>), ('available_to', <django.forms.fields.DateTimeField object at 0x7fabc76b86a0>), ('identifier', <django.forms.fields.CharField object at 0x7fabc758ad68>), ('visible_in_menu', <django.forms.fields.BooleanField object at 0x7fabc75937b8>), ('parent', <mptt.forms.TreeNodeChoiceField object at 0x7fabc758a470>), ('list_children_on_page', <django.forms.fields.BooleanField object at 0x7fabc767fb38>)])¶
-
PageForm.
declared_fields
= OrderedDict([('available_from', <django.forms.fields.DateTimeField object at 0x7fabc75797f0>), ('available_to', <django.forms.fields.DateTimeField object at 0x7fabc76b86a0>), ('title', <django.forms.fields.CharField object at 0x7fabc75930b8>), ('url', <django.forms.fields.CharField object at 0x7fabc7593358>), ('content', <django.forms.fields.CharField object at 0x7fabc7593278>)])¶
-
PageForm.
media
¶
-
class
-
class
shuup.simple_cms.admin_module.views.
PageEditView
(**kwargs)[source]¶ Bases:
shuup.admin.utils.views.CreateOrUpdateView
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
-
model
¶ alias of
Page
-
template_name
= 'shuup/simple_cms/admin/edit.jinja'¶
-
context_object_name
= 'page'¶
-
add_form_errors_as_messages
= True¶
-
-
class
shuup.simple_cms.admin_module.views.
PageListView
[source]¶ Bases:
shuup.admin.utils.views.PicotableListView
-
url_identifier
= 'simple_cms.page'¶
-
model
¶ alias of
Page
-
default_columns
= [<Column: Title> title, <Column: Available from> available_from, <Column: Available to> available_to, <Column: Created by> created_by, <Column: Date created> created_on]¶
-