Shuup
  • shuup.front.apps.carousel package
    • Subpackages
    • Submodules
    • shuup.front.apps.carousel.apps module
      • AppConfig
        • AppConfig.name
        • AppConfig.label
        • AppConfig.default_auto_field
        • AppConfig.provides
        • AppConfig.ready
    • shuup.front.apps.carousel.forms module
      • CarouselConfigForm
        • CarouselConfigForm.populate
        • CarouselConfigForm.clean
        • CarouselConfigForm.base_fields
        • CarouselConfigForm.declared_fields
        • CarouselConfigForm.media
    • shuup.front.apps.carousel.models module
      • CarouselMode
        • CarouselMode.SLIDE
        • CarouselMode.FADE
      • LinkTargetType
        • LinkTargetType.CURRENT
        • LinkTargetType.NEW
      • SlideQuerySet
        • SlideQuerySet.visible
      • Carousel
        • Carousel.shops
        • Carousel.name
        • Carousel.animation
        • Carousel.interval
        • Carousel.pause_on_hover
        • Carousel.is_arrows_visible
        • Carousel.use_dot_navigation
        • Carousel.image_width
        • Carousel.image_height
        • Carousel.arrows_color
        • Carousel.animation_class_name
        • Carousel.DoesNotExist
        • Carousel.MultipleObjectsReturned
        • Carousel.get_animation_display
        • Carousel.id
        • Carousel.objects
        • Carousel.slides
      • Slide
        • Slide.carousel
        • Slide.name
        • Slide.product_link
        • Slide.category_link
        • Slide.cms_page_link
        • Slide.ordering
        • Slide.target
        • Slide.available_from
        • Slide.available_to
        • Slide.inactive_dot_color
        • Slide.active_dot_color
        • Slide.translations
        • Slide.get_translated_field
        • Slide.get_link_url
        • Slide.is_visible
        • Slide.get_link_target
        • Slide.easy_thumbnails_thumbnailer
        • Slide.get_thumbnail
        • Slide.objects
        • Slide.DoesNotExist
        • Slide.MultipleObjectsReturned
        • Slide.caption
        • Slide.caption_text
        • Slide.carousel_id
        • Slide.category_link_id
        • Slide.cms_page_link_id
        • Slide.external_link
        • Slide.get_target_display
        • Slide.id
        • Slide.image
        • Slide.product_link_id
      • SlideTranslation
        • SlideTranslation.DoesNotExist
        • SlideTranslation.MultipleObjectsReturned
        • SlideTranslation.caption
        • SlideTranslation.caption_text
        • SlideTranslation.external_link
        • SlideTranslation.get_language_code_display
        • SlideTranslation.id
        • SlideTranslation.image
        • SlideTranslation.image_id
        • SlideTranslation.master
        • SlideTranslation.master_id
        • SlideTranslation.objects
    • shuup.front.apps.carousel.plugins module
      • CarouselPlugin
        • CarouselPlugin.identifier
        • CarouselPlugin.name
        • CarouselPlugin.template_name
        • CarouselPlugin.cacheable
        • CarouselPlugin.fields
        • CarouselPlugin.editor_form_class
        • CarouselPlugin.get_defaults
        • CarouselPlugin.get_cache_key
        • CarouselPlugin.get_context_data
      • BannerBoxPlugin
        • BannerBoxPlugin.identifier
        • BannerBoxPlugin.name
        • BannerBoxPlugin.editor_form_class
        • BannerBoxPlugin.fields
        • BannerBoxPlugin.get_context_data
    • Module contents
Shuup
  • shuup.front.apps.carousel package
  • View page source

shuup.front.apps.carousel package

Subpackages

  • shuup.front.apps.carousel.admin_module package
    • Subpackages
      • shuup.front.apps.carousel.admin_module.views package
        • Module contents
          • CarouselDeleteView
            • CarouselDeleteView.context_object_name
            • CarouselDeleteView.get
            • CarouselDeleteView.model
            • CarouselDeleteView.post
          • CarouselEditView
            • CarouselEditView.base_form_part_classes
            • CarouselEditView.context_object_name
            • CarouselEditView.form_part_class_provide_key
            • CarouselEditView.form_valid
            • CarouselEditView.get_toolbar
            • CarouselEditView.model
            • CarouselEditView.template_name
          • CarouselListView
            • CarouselListView.default_columns
            • CarouselListView.get_queryset
            • CarouselListView.model
    • Submodules
    • shuup.front.apps.carousel.admin_module.forms module
      • CarouselForm
        • CarouselForm.Meta
          • CarouselForm.Meta.model
          • CarouselForm.Meta.exclude
          • CarouselForm.Meta.widgets
        • CarouselForm.base_fields
        • CarouselForm.declared_fields
        • CarouselForm.media
      • SlideForm
        • SlideForm.Meta
          • SlideForm.Meta.model
          • SlideForm.Meta.exclude
          • SlideForm.Meta.widgets
        • SlideForm.__init__
        • SlideForm.pre_master_save
        • SlideForm.base_fields
        • SlideForm.declared_fields
        • SlideForm.media
      • SlideFormSet
        • SlideFormSet.form_class
        • SlideFormSet.model
        • SlideFormSet.validate_min
        • SlideFormSet.min_num
        • SlideFormSet.validate_max
        • SlideFormSet.max_num
        • SlideFormSet.absolute_max
        • SlideFormSet.can_delete
        • SlideFormSet.can_order
        • SlideFormSet.extra
        • SlideFormSet.__init__
        • SlideFormSet.get_queryset
        • SlideFormSet.form
    • Module contents
      • CarouselModule
        • CarouselModule.name
        • CarouselModule.breadcrumbs_menu_entry
        • CarouselModule.get_urls
        • CarouselModule.get_menu_entries
        • CarouselModule.get_model_url

Submodules

shuup.front.apps.carousel.apps module

class shuup.front.apps.carousel.apps.AppConfig(*args, **kwargs)[source]

Bases: AppConfig

name = 'shuup.front.apps.carousel'
label = 'carousel'
default_auto_field = 'django.db.models.BigAutoField'
provides = {'admin_module': ['shuup.front.apps.carousel.admin_module:CarouselModule'], 'xtheme_plugin': ['shuup.front.apps.carousel.plugins:CarouselPlugin', 'shuup.front.apps.carousel.plugins:BannerBoxPlugin']}

See /provides for details about the provides variable.

ready()[source]

Override this method in subclasses to run code when Django starts.

shuup.front.apps.carousel.forms module

class shuup.front.apps.carousel.forms.CarouselConfigForm(**kwargs)[source]

Bases: GenericPluginForm

populate()[source]
clean()[source]

Hook for doing any extra form-wide cleaning after Field.clean() has been called on every field. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field named ‘__all__’.

base_fields = {}
declared_fields = {}
property media

Return all media required to render the widgets on this form.

shuup.front.apps.carousel.models module

class shuup.front.apps.carousel.models.CarouselMode(value)[source]

Bases: Enum

SLIDE = 0
FADE = 1
class shuup.front.apps.carousel.models.LinkTargetType(value)[source]

Bases: Enum

CURRENT = 0
NEW = 1
class shuup.front.apps.carousel.models.SlideQuerySet(*args, **kwargs)[source]

Bases: 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, arrows_color)[source]

Bases: ShuupModel

shops

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

animation
interval

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

pause_on_hover

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

is_arrows_visible

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

use_dot_navigation

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

image_width

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

image_height

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

arrows_color

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

property animation_class_name
exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

get_animation_display(*, field=<enumfields.fields.EnumIntegerField: animation>)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
slides

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class shuup.front.apps.carousel.models.Slide(id, carousel, name, product_link, category_link, cms_page_link, ordering, target, available_from, available_to, inactive_dot_color, active_dot_color)[source]

Bases: TranslatableShuupModel

carousel

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

product_link

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

category_link

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

cms_page_link

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

ordering

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

target
available_from

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

available_to

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

inactive_dot_color

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

active_dot_color

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

translations

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

get_translated_field(attr)[source]
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

property 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

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

caption

Descriptor for translated attributes.

This attribute proxies all get/set calls to the translated model.

caption_text

Descriptor for translated attributes.

This attribute proxies all get/set calls to the translated model.

carousel_id
category_link_id
cms_page_link_id
external_link

Descriptor for translated attributes.

This attribute proxies all get/set calls to the translated model.

get_target_display(*, field=<enumfields.fields.EnumIntegerField: target>)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

image

Descriptor for translated attributes.

This attribute proxies all get/set calls to the translated model.

product_link_id
class shuup.front.apps.carousel.models.SlideTranslation(id, language_code, caption, caption_text, external_link, image, master)

Bases: TranslatedFieldsModel

exception DoesNotExist

Bases: TranslationDoesNotExist, DoesNotExist, DoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

caption

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

caption_text

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

external_link

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_language_code_display(*, field=<parler.utils.compat.HideChoicesCharField: language_code>)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

image

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

image_id
master

The mandatory Foreign key field to the shared model.

master_id
objects = <django.db.models.manager.Manager object>

shuup.front.apps.carousel.plugins module

class shuup.front.apps.carousel.plugins.CarouselPlugin(config)[source]

Bases: TemplatedPlugin

Instantiate a Plugin with the given config dictionary.

Parameters:

config (dict) – Dictionary of freeform configuration data

identifier = 'shuup.front.apps.carousel.carousel'
name = 'Carousel Plugin'
template_name = 'shuup/carousel/carousel.jinja'
cacheable = True
fields = [('carousel', None), ('render_image_text', <django.forms.fields.BooleanField object>)]
editor_form_class

alias of CarouselConfigForm

get_defaults()[source]

Return the default values of this plugins configuration.

Default values will be set to the plugin’s configuration and applied to the form fields’ initial values

get_cache_key(context, **kwargs) → str[source]

Return a string that is used as the cache key when the plugin can be cached

get_context_data(context)[source]

Use only slides that has translated image in current language

Parameters:

context – current context

Returns:

updated plugin context

Return type:

dict

class shuup.front.apps.carousel.plugins.BannerBoxPlugin(config)[source]

Bases: 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 = 'Banner Box'
editor_form_class

alias of CarouselConfigForm

fields = [('title', <shuup.xtheme.plugins.forms.TranslatableField object>), ('render_image_text', <django.forms.fields.BooleanField object>)]
get_context_data(context)[source]

Add title from config to context data

Parameters:

context – Current context

Returns:

updated Plugin context

Return type:

dict

Module contents


© Copyright 2012-2025, Shuup Commerce Inc..

Built with Sphinx using a theme provided by Read the Docs.