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)[source]¶ Bases:
parler.models.TranslatableModel
-
created_by
¶
-
modified_by
¶
-
translations
¶
-
objects
= <django.db.models.manager.ManagerFromPageQuerySet object>¶
-
exception
DoesNotExist
¶
-
exception
Page.
MultipleObjectsReturned
¶
-
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.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
= {'front_template_helper_namespace': ['shoop.simple_cms.template_helpers:SimpleCMSTemplateHelpers'], 'admin_module': ['shoop.simple_cms.admin_module:SimpleCMSAdminModule'], 'front_urls_post': ['shoop.simple_cms.urls:urlpatterns']}¶
-