Skip to content

component

konigle.models.website.component

Component models for the Konigle SDK.

This module provides models for component resources including creation, update, and resource representations.

BaseComponent

Bases: BaseModel

Base class for component models with common editable fields.

Contains fields that can be set during creation/update.

description = Field(default='', title='Description', description='Description of the component') class-attribute instance-attribute

Description of the component.

name = Field(..., max_length=255, title='Name', description='Name given by the user for display and search purposes') class-attribute instance-attribute

Name given by the user for display and search purposes.

template_html = Field(default='', title='Template HTML', description='Django template for the component') class-attribute instance-attribute

Django template for custom components.

version = Field(default='1.0.0', max_length=10, title='Version', description='Version of the component') class-attribute instance-attribute

Version of the component.

Component

Bases: BaseComponent, TimestampedResource

Component resource model.

Represents a reusable component for building landing pages and templates.

context = Field(default_factory=dict, title='Context', description='Component node context for fluid components') class-attribute instance-attribute

Component node context for fluid components.

thumbnail = Field(None, title='Thumbnail', description='URL of the component thumbnail image. Generated by the system') class-attribute instance-attribute

URL of the component thumbnail image. Generated by the system.

thumbnail_height = Field(None, title='Thumbnail Height', description='Height of the thumbnail image in pixels') class-attribute instance-attribute

Height of the thumbnail image in pixels.

thumbnail_width = Field(None, title='Thumbnail Width', description='Width of the thumbnail image in pixels') class-attribute instance-attribute

Width of the thumbnail image in pixels.

type = Field(default='fluid', max_length=30, title='Type', description='Type of component: fluid, dynamic, or widget') class-attribute instance-attribute

Type of component: fluid, dynamic, or widget.

ComponentCreate

Bases: BaseComponent, CreateModel

Model for creating a new component.

Contains all required and optional fields for component creation.

ComponentUpdate

Bases: UpdateModel

Model for updating an existing component.

All fields are optional for partial updates.

description = Field(None, title='Description', description='Description of the component') class-attribute instance-attribute

Description of the component.

name = Field(None, max_length=255, title='Name', description='Name given by the user for display and search purposes') class-attribute instance-attribute

Name given by the user for display and search purposes.

template_html = Field(None, title='Template HTML', description='Django template for custom components') class-attribute instance-attribute

Django template for custom components.

version = Field(None, max_length=10, title='Version', description='Version of the component') class-attribute instance-attribute

Version of the component.