shuup.front.apps.carousel package
Subpackages
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.
shuup.front.apps.carousel.forms module
- class shuup.front.apps.carousel.forms.CarouselConfigForm(**kwargs)[source]
Bases:
GenericPluginForm
- 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
andTopping.pizzas
areManyToManyDescriptor
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.
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 aReverseManyToOneDescriptor
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 aForwardManyToOneDescriptor
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 aForwardManyToOneDescriptor
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 aForwardManyToOneDescriptor
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 aForwardManyToOneDescriptor
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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:
- get_link_target()[source]
Return link target type string based on selection
- Returns:
Target type string
- Return type:
- 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 aForwardManyToOneDescriptor
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
- 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>)]