website
konigle.models.website
¶
Website models for the Konigle SDK.
This module defines models for website-related resources like folders, pages, blog posts, and glossary terms.
Backup
¶
Bases: Resource
Backup resource model.
backup_type = Field(..., title='Backup Type', description='Type of resource being backed up')
class-attribute
instance-attribute
¶
Type of resource being backed up.
created_at = Field(..., title='Created At', description='Creation timestamp.')
class-attribute
instance-attribute
¶
Creation timestamp.
description = Field(default='', max_length=255, title='Description', description="Optional user-provided description at backup time. Can be used to capture additional context, e.g. 'before major redesign' or 'before editing product description'")
class-attribute
instance-attribute
¶
Optional user-provided description of the backup.
error_message = Field(default='', title='Error Message', description='Error message if status is FAILED')
class-attribute
instance-attribute
¶
Error message if status is FAILED.
file_size_bytes = Field(default=None, title='File Size', description="Size of the backup file in bytes. Can be null if the file hasn't been created yet")
class-attribute
instance-attribute
¶
Size of the backup file in bytes.
kind = Field(..., title='Kind', description='Type of backup. Transient backups are created during editing flow/AI chat and normally restored during the same session. Durable backups are meant for long term storage and can be restored weeks or months later')
class-attribute
instance-attribute
¶
Type of backup - transient or durable.
metadata = Field(default_factory=dict, title='Metadata', description='Additional metadata about the backup that might be useful for display, searching, or restoration logic')
class-attribute
instance-attribute
¶
Additional metadata about the backup.
site = Field(..., title='Site ID', description='ID of the site this backup belongs to')
class-attribute
instance-attribute
¶
ID of the site this backup belongs to.
status = Field(..., title='Status', description='Current status of the backup')
class-attribute
instance-attribute
¶
Current status of the backup.
target_description = Field(default='', max_length=255, title='Target Description', description='Human readable description of the target. Can be used to store page name, pathname etc.')
class-attribute
instance-attribute
¶
Human readable description of the target.
target_id = Field(..., max_length=64, title='Target ID', description="Page ID, Blog ID, Folder ID, Product ID etc. NULL for site-level backups like site_foundation that aren't tied to a specific page or folder")
class-attribute
instance-attribute
¶
ID of the target resource. NULL for site-level backups.
trigger = Field(..., title='Trigger', description='What triggered the backup creation')
class-attribute
instance-attribute
¶
What triggered the backup creation.
BackupCreate
¶
Bases: CreateModel
Model for creating a new backup.
Contains fields required for backup creation.
backup_type = Field(..., title='Backup Type', description='Type of resource being backed up')
class-attribute
instance-attribute
¶
Type of resource being backed up.
description = Field(default='', max_length=255, title='Description', description='Optional user-provided description of the backup. Can be used to capture additional context')
class-attribute
instance-attribute
¶
Optional user-provided description of the backup.
target_id = Field(default=None, max_length=64, title='Target ID', description='ID of the target resource (Page, Folder, Blog, Product). NULL for site-level backups like site_foundation or site_template')
class-attribute
instance-attribute
¶
ID of the target resource. NULL for site-level backups.
trigger = Field(..., title='Trigger', description='What triggered the backup creation')
class-attribute
instance-attribute
¶
What triggered the backup creation.
Blog
¶
Bases: BaseBlog, TimestampedResource
Blog post resource model.
Represents a blog post with content, SEO metadata, and publication status.
contributors = Field(default_factory=list, title='Contributors', description='List of contributors for the blog post')
class-attribute
instance-attribute
¶
List of contributors for the blog post.
pathname = Field(default=None, title='Pathname', description='Full pathname of the blog post')
class-attribute
instance-attribute
¶
Full pathname of the blog post.
preview_url = Field(default=None, title='Preview URL', description='Preview URL of the blog post')
class-attribute
instance-attribute
¶
Preview URL of the blog post.
published = Field(default=False, title='Published', description='Whether the blog post is published')
class-attribute
instance-attribute
¶
Whether the blog post is published.
published_at = Field(None, title='Published At', description='Date and time when the blog post was published')
class-attribute
instance-attribute
¶
Date and time when the blog post was published.
reviewers = Field(default_factory=list, title='Reviewers', description='List of reviewers for the blog post')
class-attribute
instance-attribute
¶
List of reviewers for the blog post.
url = Field(default=None, title='URL', description='Public URL of the blog post')
class-attribute
instance-attribute
¶
Public URL of the blog post. Results in 404 if the blog is not published.
change_handle(new_handle, redirect=False)
¶
Change the handle of the blog post.
| PARAMETER | DESCRIPTION |
|---|---|
new_handle
|
The new handle to set for the blog post.
TYPE:
|
redirect
|
Whether to create a redirect from the old handle.
TYPE:
|
Raises: ValueError: If the new handle is invalid.
publish()
¶
Publish the blog post.
unpublish()
¶
Unpublish the blog post.
BlogCreate
¶
Bases: BaseBlog, CreateModel
Model for creating a new blog post.
Contains all required and optional fields for blog post creation.
handle = Field(default=None, max_length=255, title='Handle', description='Blog handle that is part of the URL')
class-attribute
instance-attribute
¶
Blog handle that is part of the URL.
BlogUpdate
¶
Bases: UpdateModel
Model for updating an existing blog post.
All fields are optional for partial updates.
author = Field(default=None, title='Author ID', description='ID of the primary author of the blog post')
class-attribute
instance-attribute
¶
ID of the primary author of the blog post.
content = Field(default=None, title='Content', description='Rich text blocks for the blog post in EditorJS format')
class-attribute
instance-attribute
¶
Rich text blocks for the blog post in EditorJS format.
contributor_ids = Field(default=None, title='Contributor IDs', description='List of contributor IDs for the page')
class-attribute
instance-attribute
¶
List of contributor IDs for the page.
exclude_from_sitemap = Field(default=None, title='Exclude From Sitemap', description='Whether the blog post is excluded from sitemap')
class-attribute
instance-attribute
¶
Whether the blog post is excluded from sitemap.
json_ld = Field(default=None, title='JSON-LD', description='Manual override for JSON-LD structured data')
class-attribute
instance-attribute
¶
Manual override for JSON-LD structured data.
name = Field(default=None, max_length=255, title='Name', description='Name for display and search purposes')
class-attribute
instance-attribute
¶
Name for display and search purposes.
published_at = Field(default=None, title='Published At', description='Date and time when the blog post was published')
class-attribute
instance-attribute
¶
Date and time when the blog post was published.
reviewer_ids = Field(default=None, title='Reviewer IDs', description='List of reviewer IDs for the blog post')
class-attribute
instance-attribute
¶
List of reviewer IDs for the blog post.
seo_meta = Field(default=None, title='SEO Meta', description='SEO meta information for the blog post')
class-attribute
instance-attribute
¶
SEO meta information for the blog post.
show_author = Field(default=None, title='Show Author', description='Whether to show contributors and reviewers on the page')
class-attribute
instance-attribute
¶
Whether to show contributors and reviewers on the page.
subtitle = Field(default=None, max_length=255, title='Subtitle', description='Subtitle of the blog post')
class-attribute
instance-attribute
¶
Subtitle of the blog post.
summary = Field(default=None, title='Summary', description='Blog summary - used for SEO meta description')
class-attribute
instance-attribute
¶
Blog summary - used for SEO meta description.
template = Field(default=None, title='Template ID', description='ID of the blog page design template.')
class-attribute
instance-attribute
¶
ID of the blog page design template.
title = Field(default=None, max_length=255, title='Title', description='User facing title of the blog post')
class-attribute
instance-attribute
¶
User facing title of the blog post.
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.
Folder
¶
Bases: BaseFolder, Resource
Content folder model for hierarchical organization.
Represents a folder with metadata, versioning, and publication status.
is_default_version = Field(False, title='Is Default Version', description='Whether this is the default version of the folder')
class-attribute
instance-attribute
¶
Whether this is the default version of the folder.
is_original_version = Field(True, title='Is Original Version', description='Whether this is the original version of the folder. Only original versions can have children.')
class-attribute
instance-attribute
¶
Whether this is the original version of the folder. Only original versions can have children.
managed = Field(False, title='Managed', description='Whether the folder is system-managed')
class-attribute
instance-attribute
¶
Whether the folder is system-managed.
pathname = Field(default=None, title='Pathname', description='Full pathname of the folder')
class-attribute
instance-attribute
¶
Full pathname of the page
preview_url = Field(default=None, title='Preview URL', description='Preview URL of the page')
class-attribute
instance-attribute
¶
Preview URL of the folder before publishing.
published = Field(True, title='Published', description='Whether the folder is visible on the website')
class-attribute
instance-attribute
¶
Whether the folder is visible on the website.
url = Field(default=None, title='URL', description='Public URL of the page')
class-attribute
instance-attribute
¶
Public URL of the folder. Results in 404 if the folder is not published.
version = Field(..., title='Version', description='Version of the folder for A/B testing')
class-attribute
instance-attribute
¶
Version of the folder for A/B testing.
change_handle(new_handle, redirect=False)
¶
Change the handle of the folder.
| PARAMETER | DESCRIPTION |
|---|---|
new_handle
|
The new handle to set for the folder.
TYPE:
|
redirect
|
Whether to create a redirect from the old handle.
TYPE:
|
Raises: ValueError: If the new handle is invalid.
publish()
¶
Publish the folder.
unpublish()
¶
Unpublish the folder.
FolderCreate
¶
Bases: BaseFolder, CreateModel
Model for creating a new folder.
Contains all required and optional fields for folder creation.
handle = Field(default=None, max_length=255, title='Handle', description='Unique identifier for the folder used in URLs')
class-attribute
instance-attribute
¶
Unique identifier for the folder used in URLs.
FolderType
¶
Bases: str, Enum
Folder type enumeration.
FolderUpdate
¶
Bases: UpdateModel
Model for updating an existing folder.
All fields are optional for partial updates.
canonical_page = Field(default=None, title='Canonical Page ID', description='ID of the canonical page for SEO purposes')
class-attribute
instance-attribute
¶
ID of the canonical page for SEO purposes.
context_builders = Field(default=None, title='Context Builders', description='Context builders for dynamic content')
class-attribute
instance-attribute
¶
Context builders for dynamic content.
country_code = Field(default=None, title='Country Code', description='Country code for the folder', max_length=2)
class-attribute
instance-attribute
¶
Country code for the folder.
exclude_from_sitemap = Field(default=None, title='Exclude From Sitemap', description='Whether to exclude folder from sitemap')
class-attribute
instance-attribute
¶
Whether to exclude folder from sitemap.
json_ld = Field(default=None, title='JSON-LD', description='Manual JSON-LD override for the folder')
class-attribute
instance-attribute
¶
Manual JSON-LD override for the folder.
language = Field(default=None, title='Language', description='Language code for the folder', max_length=2)
class-attribute
instance-attribute
¶
Language code for the folder.
name = Field(default=None, max_length=255, title='Name', description='Folder name for display and search purposes')
class-attribute
instance-attribute
¶
Folder name for display and search purposes.
seo_meta = Field(default=None, title='SEO Meta', description='SEO meta information for folder pages')
class-attribute
instance-attribute
¶
SEO meta information for folder pages.
tags = Field(default=None, title='Tags', description='Tags for categorization')
class-attribute
instance-attribute
¶
Tags for categorization.
template = Field(default=None, title='Template ID', description='ID of the page design template.')
class-attribute
instance-attribute
¶
ID of the page design template.
GlossaryTerm
¶
Bases: BaseGlossaryTerm, TimestampedResource
Store glossary term resource model.
Represents a glossary term with content, hierarchy, and publication status.
contributors = Field(default_factory=list, title='Contributors', description='List of contributors for the term')
class-attribute
instance-attribute
¶
List of contributors for the term.
published = Field(default=False, title='Published', description='Whether the term is published')
class-attribute
instance-attribute
¶
Whether the term is published.
published_at = Field(None, title='Published At', description='Date and time when the term was published')
class-attribute
instance-attribute
¶
Date and time when the term was published.
reviewers = Field(default_factory=list, title='Reviewers', description='List of reviewers for the term')
class-attribute
instance-attribute
¶
List of reviewers for the term.
change_handle(new_handle, redirect=False)
¶
Change the handle of the glossary term.
| PARAMETER | DESCRIPTION |
|---|---|
new_handle
|
The new handle to set for the term.
TYPE:
|
redirect
|
Whether to create a redirect from the old handle.
TYPE:
|
Raises: ValueError: If the new handle is invalid.
publish()
¶
Publish the glossary term.
unpublish()
¶
Unpublish the glossary term.
GlossaryTermCreate
¶
Bases: BaseGlossaryTerm, CreateModel
Model for creating a new glossary term.
Contains all required and optional fields for term creation.
GlossaryTermUpdate
¶
Bases: UpdateModel
Model for updating an existing glossary term.
All fields are optional for partial updates.
author = Field(default=None, title='Author', description='Primary author of the term')
class-attribute
instance-attribute
¶
Primary author of the term.
content = Field(default=None, title='Content', description='Rich text blocks for the term in EditorJS format')
class-attribute
instance-attribute
¶
Rich text blocks for the term in EditorJS format.
contributor_ids = Field(default=None, title='Contributor IDs', description='List of contributor IDs for the term')
class-attribute
instance-attribute
¶
List of contributor IDs for the term.
exclude_from_sitemap = Field(default=None, title='Exclude From Sitemap', description='Whether the term is excluded from sitemap')
class-attribute
instance-attribute
¶
Whether the term is excluded from sitemap.
json_ld = Field(default=None, title='JSON-LD', description='Manual override for JSON-LD structured data')
class-attribute
instance-attribute
¶
Manual override for JSON-LD structured data.
name = Field(default=None, max_length=255, title='Name', description='Name for display and search purposes')
class-attribute
instance-attribute
¶
Name for display and search purposes.
reviewer_ids = Field(default=None, title='Reviewer IDs', description='List of reviewer IDs for the term')
class-attribute
instance-attribute
¶
List of reviewer IDs for the term.
seo_meta = Field(default=None, title='SEO Meta', description='SEO meta information for the term')
class-attribute
instance-attribute
¶
SEO meta information for the term.
show_author = Field(default=None, title='Show Author', description='Whether to show contributors and reviewers on the page')
class-attribute
instance-attribute
¶
Whether to show contributors and reviewers on the page.
subtitle = Field(default=None, max_length=255, title='Subtitle', description='Subtitle of the glossary term')
class-attribute
instance-attribute
¶
Subtitle of the glossary term.
summary = Field(default=None, title='Summary', description='Term summary - used for SEO meta description')
class-attribute
instance-attribute
¶
Term summary - used for SEO meta description.
title = Field(default=None, max_length=255, title='Title', description='User facing title of the glossary term')
class-attribute
instance-attribute
¶
User facing title of the glossary term.
Page
¶
Bases: BasePage, TimestampedResource
General purpose page resource model.
Represents a page with content, type, and publication status.
content_file = Field(default=None, title='Content File', description='URL of the content file if data source is file')
class-attribute
instance-attribute
¶
URL of the content file if data source is file.
contributors = Field(default_factory=list, title='Contributors', description='List of contributors for the page')
class-attribute
instance-attribute
¶
List of contributors for the page.
pathname = Field(default=None, title='Pathname', description='Full pathname of the page')
class-attribute
instance-attribute
¶
Full pathname of the page
preview_url = Field(default=None, title='Preview URL', description='Preview URL of the page')
class-attribute
instance-attribute
¶
Preview URL of the page
published = Field(default=False, title='Published', description='Whether the page is published')
class-attribute
instance-attribute
¶
Whether the page is published.
published_at = Field(None, title='Published At', description='Date and time when the page was published')
class-attribute
instance-attribute
¶
Date and time when the page was published.
reviewers = Field(default_factory=list, title='Reviewers', description='List of reviewers for the page')
class-attribute
instance-attribute
¶
List of reviewers for the page.
url = Field(default=None, title='URL', description='Public URL of the page')
class-attribute
instance-attribute
¶
Public URL of the page. Results in 404 if the page is not published.
apublish()
async
¶
Publish the page.
change_handle(new_handle, redirect=False)
¶
Change the handle of the page.
| PARAMETER | DESCRIPTION |
|---|---|
new_handle
|
The new handle to set for the page.
TYPE:
|
redirect
|
Whether to create a redirect from the old handle.
TYPE:
|
Raises: ValueError: If the new handle is invalid.
publish()
¶
Publish the page.
unpublish()
¶
Unpublish the page.
PageCreate
¶
Bases: BasePage, ContentFileMixin, CreateModel
Model for creating a new page.
Contains all required and optional fields for page creation.
PageUpdate
¶
Bases: ContentFileMixin, UpdateModel
Model for updating an existing page.
All fields are optional for partial updates.
author = Field(default=None, title='Author', description='Primary author of the page')
class-attribute
instance-attribute
¶
Primary author of the page.
content = Field(default=None, title='Content', description='Rich text blocks for the page in EditorJS format')
class-attribute
instance-attribute
¶
Rich text blocks for the page in EditorJS format.
context_builders = Field(default=None, title='Context Builders', description='Context builders for dynamic content')
class-attribute
instance-attribute
¶
Context builders for dynamic content.
contributor_ids = Field(default=None, title='Contributor IDs', description='List of contributor IDs for the page')
class-attribute
instance-attribute
¶
List of contributor IDs for the page.
exclude_from_sitemap = Field(default=None, title='Exclude From Sitemap', description='Whether the page is excluded from sitemap')
class-attribute
instance-attribute
¶
Whether the page is excluded from sitemap.
json_ld = Field(default=None, title='JSON-LD', description='Manual override for JSON-LD structured data')
class-attribute
instance-attribute
¶
Manual override for JSON-LD structured data.
name = Field(default=None, max_length=255, title='Name', description='Name for display and search purposes')
class-attribute
instance-attribute
¶
Name for display and search purposes.
published_at = Field(default=None, title='Published At', description='Date and time when the page was published')
class-attribute
instance-attribute
¶
Date and time when the page was published.
reviewer_ids = Field(default=None, title='Reviewer IDs', description='List of reviewer IDs for the page')
class-attribute
instance-attribute
¶
List of reviewer IDs for the page.
seo_meta = Field(default=None, title='SEO Meta', description='SEO meta information for the page')
class-attribute
instance-attribute
¶
SEO meta information for the page.
show_author = Field(default=None, title='Show Author', description='Whether to show contributors and reviewers on the page')
class-attribute
instance-attribute
¶
Whether to show contributors and reviewers on the page.
subtitle = Field(default=None, max_length=255, title='Subtitle', description='Subtitle of the page')
class-attribute
instance-attribute
¶
Subtitle of the page.
template = Field(default=None, title='Template ID', description='ID of the page design template.')
class-attribute
instance-attribute
¶
ID of the page design template.
title = Field(default=None, max_length=255, title='Title', description='User facing title of the page')
class-attribute
instance-attribute
¶
User facing title of the page.
Redirect
¶
RedirectCreate
¶
RedirectUpdate
¶
Bases: UpdateModel
Model for updating redirect resources.
path = Field(default=None)
class-attribute
instance-attribute
¶
Source path for the redirect.
permanent = Field(default=None)
class-attribute
instance-attribute
¶
Whether the redirect is permanent (HTTP 301) or temporary (HTTP 302).
target = Field(default=None)
class-attribute
instance-attribute
¶
Target path for the redirect.
Template
¶
Bases: BaseTemplate, TimestampedResource
Template resource model.
Represents a template for building landing pages with components.
handle = Field(..., max_length=255, title='Handle', description='Handle to identify template')
class-attribute
instance-attribute
¶
Handle to identify template
included_component_ids = Field(default_factory=list, title='Included Component IDs', description='List of component IDs included in the template')
class-attribute
instance-attribute
¶
List of component IDs included in the template. This is a computed field.
TemplateCreate
¶
Bases: BaseTemplate, CreateModel
Model for creating a new template.
Contains all required and optional fields for template creation.
TemplateUpdate
¶
Bases: UpdateModel
Model for updating an existing template.
All fields are optional for partial updates.
base = Field(default=None, title='Base Template', description='Base template ID for this template')
class-attribute
instance-attribute
¶
Base template ID for this template.
body_end_snippets = Field(default=None, title='Body End Snippets', description='HTML snippets to inject before </body>')
class-attribute
instance-attribute
¶
HTML snippets to inject before