shoop.simple_cms package¶
Subpackages¶
Submodules¶
shoop.simple_cms.models module¶
-
class
shoop.simple_cms.models.
PageQuerySet
(*args, **kwargs)[source]¶ Bases:
parler.managers.TranslatableQuerySet
-
visible
(dt=None)[source]¶ Get pages that should be publicly visible.
This does not do permission checking.
Parameters: dt (datetime.datetime) – Datetime for visibility check Returns: QuerySet of pages. Return type: QuerySet[Page]
-
-
class
shoop.simple_cms.models.
Page
(id, available_from, available_to, created_by, modified_by, created_on, modified_on, identifier, visible_in_menu, parent, list_children_on_page)[source]¶ Bases:
mptt.models.MPTTModel
,parler.models.TranslatableModel
-
created_by
¶
-
modified_by
¶
-
parent
¶
-
translations
¶
-
objects
= <django.db.models.manager.TreeManagerFromPageQuerySet object>¶
-
exception
DoesNotExist
¶
-
exception
Page.
MultipleObjectsReturned
¶
-
Page.
children
¶
-
Page.
content
¶ Descriptor for translated attributes.
This attribute proxies all get/set calls to the translated model.
-
Page.
get_next_by_created_on
(*moreargs, **morekwargs)¶
-
Page.
get_next_by_modified_on
(*moreargs, **morekwargs)¶
-
Page.
get_previous_by_created_on
(*moreargs, **morekwargs)¶
-
Page.
get_previous_by_modified_on
(*moreargs, **morekwargs)¶
-
Page.
title
¶ Descriptor for translated attributes.
This attribute proxies all get/set calls to the translated model.
-
Page.
url
¶ Descriptor for translated attributes.
This attribute proxies all get/set calls to the translated model.
-
-
class
shoop.simple_cms.models.
PageTranslation
(id, language_code, title, url, content, master)¶ Bases:
parler.models.TranslatedFieldsModel
-
exception
DoesNotExist
¶ Bases:
parler.models.TranslationDoesNotExist
,shoop.simple_cms.models.DoesNotExist
,shoop.simple_cms.models.DoesNotExist
-
exception
PageTranslation.
MultipleObjectsReturned
¶
-
PageTranslation.
get_language_code_display
(*moreargs, **morekwargs)¶
-
PageTranslation.
master
¶
-
PageTranslation.
objects
= <django.db.models.manager.Manager object>¶
-
exception
shoop.simple_cms.plugins module¶
-
class
shoop.simple_cms.plugins.
PageLinksConfigForm
(**kwargs)[source]¶ Bases:
shoop.xtheme.plugins.forms.GenericPluginForm
A configuration for the PageLinksPlugin
-
clean
()[source]¶ A custom clean method to save page configuration information in a serializable form
-
base_fields
= OrderedDict()¶
-
declared_fields
= OrderedDict()¶
-
media
¶
-
-
class
shoop.simple_cms.plugins.
PageLinksPlugin
(config)[source]¶ Bases:
shoop.xtheme.TemplatedPlugin
A plugin for displaying links to visible CMS pages in the shop front
Instantiate a Plugin with the given
config
dictionary.Parameters: config (dict) – Dictionary of freeform configuration data -
identifier
= 'simple_cms.page_links'¶
-
name
= <django.utils.functional.lazy.<locals>.__proxy__ object>¶
-
template_name
= 'shoop/simple_cms/plugins/page_links.jinja'¶
-
editor_form_class
¶ alias of
PageLinksConfigForm
-
fields
= [('title', <shoop.xtheme.plugins.forms.TranslatableField object at 0x7f5300eeac50>), ('show_all_pages', <django.forms.fields.BooleanField object at 0x7f5300d95978>), ('hide_expired', <django.forms.fields.BooleanField object at 0x7f5300d95320>), 'pages']¶
-
shoop.simple_cms.template_helpers module¶
shoop.simple_cms.urls module¶
shoop.simple_cms.views module¶
-
class
shoop.simple_cms.views.
PageView
(**kwargs)[source]¶ Bases:
django.views.generic.detail.DetailView
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
-
model
¶ alias of
Page
-
slug_field
= 'translations__url'¶
-
slug_url_kwarg
= 'url'¶
-
template_name
= 'shoop/simple_cms/page.jinja'¶
-
context_object_name
= 'page'¶
-
get
(request, *args, **kwargs)[source]¶ Override normal get method to return correct page based on the active language and slug
- Cases:
Page is not found:
raise Http404()
like django wouldNo translation in active language for the page:
raise Http404()
- Translation was found for active language, but the url doesn’t match given url:
return HttpResponseRedirect
to the active languages url
If none of the upper matches: render page normally
-
Module contents¶
-
class
shoop.simple_cms.
AppConfig
(*args, **kwargs)[source]¶ Bases:
shoop.apps.AppConfig
-
name
= 'shoop.simple_cms'¶
-
verbose_name
= <django.utils.functional.lazy.<locals>.__proxy__ object>¶
-
label
= 'shoop_simple_cms'¶
-
provides
= {'xtheme_plugin': ['shoop.simple_cms.plugins:PageLinksPlugin'], 'front_template_helper_namespace': ['shoop.simple_cms.template_helpers:SimpleCMSTemplateHelpers'], 'front_urls_post': ['shoop.simple_cms.urls:urlpatterns'], 'admin_module': ['shoop.simple_cms.admin_module:SimpleCMSAdminModule']}¶
-