shuup.front.apps.carousel package¶
Subpackages¶
Submodules¶
shuup.front.apps.carousel.apps module¶
-
class
shuup.front.apps.carousel.apps.
AppConfig
(*args, **kwargs)[source]¶ Bases:
shuup.apps.AppConfig
-
name
= 'shuup.front.apps.carousel'¶
-
label
= 'carousel'¶
-
provides
= {'xtheme_plugin': ['shuup.front.apps.carousel.plugins:CarouselPlugin', 'shuup.front.apps.carousel.plugins:BannerBoxPlugin'], 'admin_module': ['shuup.front.apps.carousel.admin_module:CarouselModule']}¶
-
shuup.front.apps.carousel.forms module¶
shuup.front.apps.carousel.models module¶
-
class
shuup.front.apps.carousel.models.
CarouselMode
[source]¶ Bases:
enumfields.enums.Enum
An enumeration.
-
SLIDE
= <CarouselMode.SLIDE: 0>¶
-
FADE
= <CarouselMode.FADE: 1>¶
-
-
class
shuup.front.apps.carousel.models.
LinkTargetType
[source]¶ Bases:
enumfields.enums.Enum
An enumeration.
-
CURRENT
= <LinkTargetType.CURRENT: 0>¶
-
NEW
= <LinkTargetType.NEW: 1>¶
-
-
class
shuup.front.apps.carousel.models.
SlideQuerySet
(*args, **kwargs)[source]¶ Bases:
parler.managers.TranslatableQuerySet
-
visible
(dt=None)[source]¶ Get slides that should be publicly visible.
This does not do permission checking.
Parameters: dt (datetime.datetime) – Datetime for visibility check Returns: QuerySet of slides. Return type: QuerySet[Slide]
-
-
class
shuup.front.apps.carousel.models.
Carousel
(id, name, animation, interval, pause_on_hover, is_arrows_visible, use_dot_navigation, image_width, image_height)[source]¶ Bases:
shuup.core.models.ShuupModel
Parameters: - id (AutoField) – Id
- name (CharField) – The carousel name use for carousel configuration.
- animation (EnumIntegerField) – Animation type for cycling slides.
- interval (IntegerField) – Slide interval in seconds.
- pause_on_hover (BooleanField) – When checked, the carousel cycling pauses on mouse over.
- is_arrows_visible (BooleanField) – When checked, navigational arrows are shown on the carousel allowing for customers to go back and forward.
- use_dot_navigation (BooleanField) – When checked, navigational indicator dots are shown.
- image_width (IntegerField) – Slide images will be cropped to this width.
- image_height (IntegerField) – Slide images will be cropped to this height.
-
slides
¶ ManyToOneRel to
shuup.front.apps.carousel.models.Slide
-
animation
¶ A placeholder class that provides a way to set the attribute on the model.
-
animation_class_name
¶
-
exception
DoesNotExist
¶
-
exception
Carousel.
MultipleObjectsReturned
¶
-
Carousel.
get_animation_display
(*moreargs, **morekwargs)¶
-
Carousel.
objects
= <django.db.models.manager.Manager object>¶
-
Carousel.
slides
-
class
shuup.front.apps.carousel.models.
Slide
(id, carousel, name, product_link, category_link, cms_page_link, ordering, target, available_from, available_to)[source]¶ Bases:
shuup.core.models.TranslatableShuupModel
Parameters: - id (AutoField) – Id
- carousel (ForeignKey to
shuup.front.apps.carousel.models.Carousel
) – Carousel - name (CharField) – Name is only used to configure slides.
- product_link (ForeignKey to
shuup.core.models.Product
) – Set the product detail page that should be shown when this slide is clicked, if any. - category_link (ForeignKey to
shuup.core.models.Category
) – Set the product category page that should be shown when this slide is clicked, if any. - cms_page_link (ForeignKey to
shuup.simple_cms.models.Page
) – Set the web page that should be shown when the slide is clicked, if any. - ordering (IntegerField) – Set the numeric order in which this slide should appear relative to other slides in this carousel.
- target (EnumIntegerField) – Set this to current if clicking on this slide should open a new browser tab.
- available_from (DateTimeField) – Set the date and time from which this slide should be visible in the carousel. This is useful to advertise sales campaigns or other time-sensitive marketing.
- available_to (DateTimeField) – Set the date and time from which this slide should be visible in the carousel. This is useful to advertise sales campaigns or other time-sensitive marketing.
- caption (CharField) – (Translatable) Text that describes the image. Used for search engine purposes.
- caption_text (TextField) – (Translatable) When displayed in banner box mode, caption text is shown as a tooltip
- external_link (CharField) – (Translatable) Set the external site that should be shown when this slide is clicked, if any.
- image (FilerImageField to
filer.models.imagemodels.Image
) – (Translatable) The slide image to show.
-
translations
¶ ManyToOneRel to
shuup.front.apps.carousel.models.SlideTranslation
-
carousel
¶
-
product_link
¶
-
category_link
¶
-
cms_page_link
¶
-
target
¶ A placeholder class that provides a way to set the attribute on the model.
-
translations
-
get_link_url
()[source]¶ Get right link url for this slide.
Initially external link is used. If not set link will fallback to product_link, external_link or cms_page_link in this order.
Returns: return correct link url for slide if set Return type: str|None
-
is_visible
(dt=None)[source]¶ Get slides that should be publicly visible.
This does not do permission checking.
Parameters: dt (datetime.datetime) – Datetime for visibility check Returns: Public visibility status Return type: bool
-
get_link_target
()[source]¶ Return link target type string based on selection
Returns: Target type string Return type: str
-
easy_thumbnails_thumbnailer
¶ Get Thumbnailer instance for the translated image. Will return None if file cannot be thumbnailed. :rtype:easy_thumbnails.files.Thumbnailer|None
-
get_thumbnail
(**kwargs)[source]¶ Get thumbnail for the translated image This will return None if there is no file :rtype: easy_thumbnails.files.ThumbnailFile|None
-
objects
= <django.db.models.manager.ManagerFromSlideQuerySet object>¶
-
exception
DoesNotExist
¶
-
exception
Slide.
MultipleObjectsReturned
¶
Descriptor for translated attributes.
This attribute proxies all get/set calls to the translated model.
Descriptor for translated attributes.
This attribute proxies all get/set calls to the translated model.
-
Slide.
external_link
¶ Descriptor for translated attributes.
This attribute proxies all get/set calls to the translated model.
-
Slide.
get_target_display
(*moreargs, **morekwargs)¶
-
Slide.
image
¶ Descriptor for translated attributes.
This attribute proxies all get/set calls to the translated model.
-
class
shuup.front.apps.carousel.models.
SlideTranslation
(id, language_code, caption, caption_text, external_link, image, master)¶ Bases:
parler.models.TranslatedFieldsModel
Parameters: - id (AutoField) – Id
- language_code (HideChoicesCharField) – Language
- caption (CharField) – Text that describes the image. Used for search engine purposes.
- caption_text (TextField) – When displayed in banner box mode, caption text is shown as a tooltip
- external_link (CharField) – Set the external site that should be shown when this slide is clicked, if any.
- image (FilerImageField to
filer.models.imagemodels.Image
) – The slide image to show. - master (ForeignKey to
shuup.front.apps.carousel.models.Slide
) – Master
-
exception
DoesNotExist
¶ Bases:
parler.models.TranslationDoesNotExist
,shuup.front.apps.carousel.models.DoesNotExist
,shuup.front.apps.carousel.models.DoesNotExist
-
exception
SlideTranslation.
MultipleObjectsReturned
¶
-
SlideTranslation.
get_language_code_display
(*moreargs, **morekwargs)¶
-
SlideTranslation.
image
¶
-
SlideTranslation.
master
¶
-
SlideTranslation.
objects
= <django.db.models.manager.Manager object>¶
shuup.front.apps.carousel.plugins module¶
-
class
shuup.front.apps.carousel.plugins.
CarouselPlugin
(config)[source]¶ Bases:
shuup.xtheme.TemplatedPlugin
Instantiate a Plugin with the given
config
dictionary.Parameters: config (dict) – Dictionary of freeform configuration data -
identifier
= 'shuup.front.apps.carousel.carousel'¶
-
name
= <django.utils.functional.lazy.<locals>.__proxy__ object>¶
-
template_name
= 'shuup/carousel/carousel.jinja'¶
-
fields
= [('carousel', None)]¶
-
editor_form_class
¶ alias of
CarouselConfigForm
-
-
class
shuup.front.apps.carousel.plugins.
BannerBoxPlugin
(config)[source]¶ Bases:
shuup.front.apps.carousel.plugins.CarouselPlugin
Instantiate a Plugin with the given
config
dictionary.Parameters: config (dict) – Dictionary of freeform configuration data -
identifier
= 'shuup.front.apps.carousel.banner_box'¶
-
name
= <django.utils.functional.lazy.<locals>.__proxy__ object>¶
-
editor_form_class
¶ alias of
CarouselConfigForm
-
fields
= [('title', <shuup.xtheme.plugins.forms.TranslatableField object at 0x7fabc9eb07f0>)]¶
-