django_dynamic_theme.models =========================== .. py:module:: django_dynamic_theme.models .. autoapi-nested-parse:: Admins modles for Theme. Classes ------- .. autoapisummary:: django_dynamic_theme.models.FontSizeChoice django_dynamic_theme.models.AbstractModelMeta django_dynamic_theme.models.ThemeElement django_dynamic_theme.models.Background django_dynamic_theme.models.MediaGallery django_dynamic_theme.models.Navbar django_dynamic_theme.models.Theme Module Contents --------------- .. py:class:: FontSizeChoice Bases: :py:obj:`django.db.models.TextChoices` List of pre defined css font sizes. Or px or em or % see https://developer.mozilla.org/en-US/docs/Web/CSS/font-size .. py:attribute:: XX_SMALL :value: 'xx-small' .. py:attribute:: X_SMALL :value: 'x-small' .. py:attribute:: SMALL :value: 'small' .. py:attribute:: MEDIUM :value: 'medium' .. py:attribute:: LARGE :value: 'large' .. py:attribute:: X_LARGE :value: 'x-large' .. py:attribute:: XX_LARGE :value: 'xx-large' .. py:attribute:: XXX_LARGE :value: 'xxx-large' .. py:class:: AbstractModelMeta Bases: :py:obj:`abc.ABCMeta`, :py:obj:`type`\ (\ :py:obj:`models.Model`\ ) Abstract class for the meta to avoid metaclass exception .. py:class:: ThemeElement Bases: :py:obj:`django.db.models.Model` Abstract class for theme elements. :param name: The name of that configuration. .. py:attribute:: name .. py:class:: Meta Meta class for ThemeElement .. py:attribute:: abstract :value: True .. py:method:: export() -> str :abstractmethod: Exports the key value pairs as string. .. py:method:: save(*args, **kwargs) -> None Saves the ThemeElement object and triggers the themes to write it's content to the SCSS file. .. py:method:: __str__() -> str Returns the name as string conversion. .. py:method:: __repr__() -> str Returns the type and the name as representation. .. py:class:: Background Bases: :py:obj:`ThemeElement` Stores the background colors. :param primary_bg: The color of the primary background. .. py:attribute:: primary_bg .. py:method:: export() -> str Exports it's values as string in SCSS format. .. py:class:: MediaGallery Bases: :py:obj:`ThemeElement` A specialization of a n-dimensional list for the purpose of videos / images. :param margin_left: The margin of the entire media gallery on left side. :param margin_right: The margin of the entire media gallery on right side. :param max_width: The maximum width of the entire media gallery. :param item_align: The align of the single items within a row. :param row_margin_top: The top margin between rows. .. py:attribute:: margin_left .. py:attribute:: margin_right .. py:attribute:: max_width .. py:attribute:: item_align .. py:attribute:: row_margin_top .. py:class:: Meta Meta definitions of Media Gallery .. py:attribute:: verbose_name :value: 'Media Gallery' .. py:attribute:: verbose_name_plural :value: 'Media Galleries' .. py:method:: export() -> str Returns configuration as string. .. py:class:: Navbar Bases: :py:obj:`ThemeElement` Stores the theming of bootstrap 5 nav bar :param background_color: Background color of the Navbar :param opacity: How transparent the background is. 0 is full transparent. :param font_size: The size of nav bar font. :param text_color: Color of the nav bar text. :param text_opacity: How transparent the text is. 0 is full transparent. .. py:attribute:: background_color .. py:attribute:: opacity .. py:attribute:: font_size .. py:attribute:: text_color .. py:attribute:: text_opacity .. py:method:: export() -> str Exports the navbar properties as strings. .. py:class:: Theme Bases: :py:obj:`django.db.models.Model` Combines all values. :param name: Name of the theme. Also used as file name + .scss. See self.path() :param default: Unique. If that is the default theme. :param background: ThemeElement for background. :param media_gallery: ThemeElement for media gallery. :param navrbar: ThemeElement for nav bar. .. py:attribute:: name .. py:attribute:: default .. py:attribute:: background :type: Background .. py:attribute:: media_gallery :type: MediaGallery .. py:attribute:: navbar :type: Navbar .. py:class:: Meta Meta class of the Theme. .. py:attribute:: constraints .. py:property:: path :type: str Returns the path based on the file name. .. py:method:: export() -> str Exports all listed configurations as string in SCSS format. .. py:method:: write_export() -> None Writes the content of the export to the file. .. py:method:: save(*args, **kwargs) -> None Saves the Theme object and writes it's content to the SCSS file.