Skip to content

author

konigle.models.website.author

Author models for the Konigle SDK.

This module provides models for content authors including creation, update, and resource representations.

Author

Bases: BaseAuthor, Resource

Author resource model.

Represents a content author with profile information and social links.

avatar = Field(None, title='Avatar', description='Author avatar URL') class-attribute instance-attribute

Author avatar URL.

avatar_height = Field(None, title='Avatar Height', description='Original height of the author avatar') class-attribute instance-attribute

Original height of the author avatar.

avatar_width = Field(None, title='Avatar Width', description='Original width of the author avatar') class-attribute instance-attribute

Original width of the author avatar.

AuthorReference

Bases: BaseModel

Lightweight author reference for foreign key relationships.

Used when APIs return minimal author data in list responses or when only basic author information is needed.

id = Field(..., title='Author ID', description='Unique identifier for the author') class-attribute instance-attribute

Unique identifier for the author.

name = Field(None, title='Name', description='Name of the author') class-attribute instance-attribute

Name of the author.

AvatarMixin

avatar = Field(None, title='Avatar', description='Avatar to upload. Can be file path, bytes, BytesIO, BinaryIO, or tuple of (file_data, filename)') class-attribute instance-attribute

Avatar file to upload. Can be file path, bytes, BytesIO, BinaryIO, or tuple of (file_data, filename)

normalize_file()

Convert file paths or bytes to FileInput.

validate_avatar(v) classmethod

Ensure we're uploading an image file.

BaseAuthor

Bases: BaseModel

Base class for author models with common editable fields.

Contains fields that can be set during creation/update.

bio = Field(default='', title='Bio', description='Brief bio of the author') class-attribute instance-attribute

Brief bio of the author.

email = Field(default='', title='Email', description='Email of the author') class-attribute instance-attribute

Email of the author.

handle = Field(..., max_length=50, title='Handle', description='URL handle for the author') class-attribute instance-attribute

URL handle for the author.

name = Field(..., max_length=255, title='Name', description='Name of the author') class-attribute instance-attribute

Name of the author.

Social links of the author. Ex. Twitter, Facebook, LinkedIn.

tagline = Field(default='', max_length=255, title='Tagline', description='Author tagline. Ex. Marketing Head') class-attribute instance-attribute

Author tagline. Ex. Marketing Head.

CreateAuthor

Bases: AvatarMixin, BaseAuthor, CreateModel

Model for creating a new author.

Contains all required and optional fields for author creation.

Bases: BaseModel

facebook = Field(None, title='Facebook', description="Author's Facebook profile URL") class-attribute instance-attribute

Author's Facebook profile URL.

linkedin = Field(None, title='LinkedIn', description="Author's LinkedIn profile URL") class-attribute instance-attribute

Author's LinkedIn profile URL.

twitter = Field(None, title='Twitter', description="Author's Twitter profile URL") class-attribute instance-attribute

Author's Twitter profile URL.

website = Field(None, title='Website', description="Author's personal or professional website URL") class-attribute instance-attribute

Author's personal or professional website URL.

UpdateAuthor

Bases: AvatarMixin, UpdateModel

Model for updating an existing author.

All fields are optional for partial updates.

bio = Field(None, title='Bio', description='Brief bio of the author') class-attribute instance-attribute

Brief bio of the author.

email = Field(None, title='Email', description='Email of the author') class-attribute instance-attribute

Email of the author.

handle = Field(None, max_length=50, title='Handle', description='URL handle for the author') class-attribute instance-attribute

URL handle for the author.

name = Field(None, max_length=255, title='Name', description='Name of the author') class-attribute instance-attribute

Name of the author.

Social links of the author. Ex. Twitter, Facebook, LinkedIn.

tagline = Field(None, max_length=255, title='Tagline', description='Author tagline. Ex. Marketing Head') class-attribute instance-attribute

Author tagline. Ex. Marketing Head.