coalition.content.models.content_block ====================================== .. py:module:: coalition.content.models.content_block .. autoapi-nested-parse:: ContentBlock model for flexible homepage content sections. Classes ------- .. autoapisummary:: coalition.content.models.content_block.ContentBlock Module Contents --------------- .. py:class:: ContentBlock(*args, **kwargs) Bases: :py:obj:`django.db.models.Model` Flexible content blocks that can be added to any page. Allows for dynamic content sections beyond the fixed structure. .. py:attribute:: BLOCK_TYPES :value: [('text', 'Text Block'), ('image', 'Image Block'), ('text_image', 'Text + Image Block'),... .. py:attribute:: PAGE_TYPES :value: [('homepage', 'Homepage'), ('about', 'About Page'), ('campaigns', 'Campaigns Page'), ('contact',... .. py:attribute:: LAYOUT_OPTIONS :value: [('default', 'Text Left, Image Right'), ('reversed', 'Image Left, Text Right'), ('stacked',... .. py:attribute:: VERTICAL_ALIGNMENT_OPTIONS :value: [('top', 'Top'), ('middle', 'Center'), ('bottom', 'Bottom')] .. py:attribute:: ANIMATION_OPTIONS :value: [('fade-in', 'Fade In'), ('slide-up', 'Slide Up'), ('slide-left', 'Slide from Left'),... .. py:attribute:: page_type .. py:attribute:: title .. py:attribute:: block_type .. py:attribute:: content .. py:attribute:: image .. py:attribute:: layout_option .. py:attribute:: vertical_alignment .. py:attribute:: css_classes .. py:attribute:: background_color .. py:attribute:: animation_type .. py:attribute:: animation_delay .. py:attribute:: order .. py:attribute:: is_visible .. py:attribute:: created_at .. py:attribute:: updated_at .. py:class:: Meta .. py:attribute:: db_table :value: 'content_block' .. py:attribute:: ordering :value: ['order', 'created_at'] .. py:attribute:: verbose_name :value: 'Content Block' .. py:attribute:: verbose_name_plural :value: 'Content Blocks' .. py:method:: __str__() -> str .. py:property:: image_url :type: str Return the URL of the uploaded image, or empty string if no image. .. py:property:: image_alt_text :type: str Return the alt text of the image, or empty string if no image. .. py:property:: image_title :type: str Return the title of the image, or empty string if no image. .. py:property:: image_author :type: str Return the author of the image, or empty string if no image. .. py:property:: image_license :type: str Return the license of the image, or empty string if no image. .. py:property:: image_source_url :type: str Return the source URL of the image, or empty string if no image. .. py:property:: image_caption :type: str Return the caption of the image, or empty string if no image. .. py:property:: image_caption_display :type: str Return the caption display setting of the image, or 'below' if no image. .. py:method:: save(*args: Any, **kwargs: Any) -> None Sanitize content based on block type before saving.