blogs¶
Blogs domain.
- class BlogEntry[source]¶
Bases:
AuditBase- __init__(**kwargs)¶
A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
- created_at: Mapped[datetime.datetime]¶
Date/time of instance creation.
- id: Mapped[UUID]¶
UUID Primary key column.
- updated_at: Mapped[datetime.datetime]¶
Date/time of instance last update.
- class BlogEntryController[source]¶
Bases:
ControllerController for BlogEntry CRUD operations.
- after_request: AfterRequestHookHandler | None¶
A sync or async function executed before a
Requestis passed to any route handler.If this function returns a value, the request will not reach the route handler, and instead this value will be used.
- after_response: AfterResponseHookHandler | None¶
A sync or async function called after the response has been awaited.
It receives the
Requestinstance and should not return any values.
- before_request: BeforeRequestHookHandler | None¶
A sync or async function called immediately before calling the route handler.
It receives the
Requestinstance and any non-Nonereturn value is used for the response, bypassing the route handler.
- cache_control: CacheControlHeader | None¶
A
CacheControlHeaderheader to add to route handlers of this controller.Can be overridden by route handlers.
- dependencies: Dependencies | None¶
A string keyed dictionary of dependency
Providerinstances.
- dto: type[AbstractDTO] | None | EmptyType¶
AbstractDTOto use for (de)serializing and validation of request data.
- etag: ETag | None¶
An
etagheader of typeETagto add to route handlers of this controller.Can be overridden by route handlers.
- exception_handlers: ExceptionHandlersMap | None¶
A map of handler functions to status codes and/or exception types.
- guards: Sequence[Guard] | None¶
A sequence of
Guardcallables.
- include_in_schema: bool | EmptyType¶
A boolean flag dictating whether the route handler should be documented in the OpenAPI schema
- middleware: Sequence[Middleware] | None¶
A sequence of
Middleware.
- opt: Mapping[str, Any] | None¶
A string key mapping of arbitrary values that can be accessed in
Guardsor wherever you have access toRequestorASGI Scope.
- owner: Router¶
The
RouterorLitestarapp that owns the controller.This value is set internally by Litestar and it should not be set when subclassing the controller.
- parameters: ParametersMap | None¶
A mapping of
Parameterdefinitions available to all application paths.
- path: str¶
A path fragment for the controller.
All route handlers under the controller will have the fragment appended to them. If not set it defaults to
/.
- request_class: type[Request] | None¶
A custom subclass of
Requestto be used as the default request for all route handlers under the controller.
- request_max_body_size: int | None | EmptyType¶
Maximum allowed size of the request body in bytes. If this size is exceeded, a ‘413 - Request Entity Too Large’ error response is returned.
- response_class: type[Response] | None¶
A custom subclass of
Responseto be used as the default response for all route handlers under the controller.
- response_cookies: ResponseCookies | None¶
A list of
Cookieinstances.
- response_headers: ResponseHeaders | None¶
A string keyed dictionary mapping
ResponseHeaderinstances.
- return_dto: type[AbstractDTO] | None | EmptyType¶
AbstractDTOto use for serializing outbound response data.
- security: Sequence[SecurityRequirement] | None¶
A sequence of dictionaries that to the schema of all route handlers under the controller.
- signature_namespace: dict[str, Any]¶
A mapping of names to types for use in forward reference resolution during signature modelling.
- signature_types: Sequence[Any]¶
A sequence of types for use in forward reference resolution during signature modelling.
These types will be added to the signature namespace using their
__name__attribute.
- tags: Sequence[str] | None¶
A sequence of string tags that will be appended to the schema of all route handlers under the controller.
- type_decoders: TypeDecodersSequence | None¶
A sequence of tuples, each composed of a predicate testing for type identity and a msgspec hook for deserialization.
- type_encoders: TypeEncodersMap | None¶
A mapping of types to callables that transform them into types supported for serialization.
- websocket_class: type[WebSocket] | None¶
A custom subclass of
WebSocketto be used as the default websocket for all route handlers under the controller.
- class BlogEntryCreate[source]¶
Bases:
BlogEntryBaseSchema for creating a new BlogEntry.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class BlogEntryList[source]¶
Bases:
BaseModelSchema for BlogEntry list items.
- model_config: ClassVar[ConfigDict] = {'from_attributes': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class BlogEntryRead[source]¶
Bases:
BlogEntryBaseSchema for reading BlogEntry data.
- model_config: ClassVar[ConfigDict] = {'from_attributes': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class BlogEntryRepository[source]¶
Bases:
SQLAlchemyAsyncRepository[BlogEntry]Repository for BlogEntry database operations.
- class BlogEntryService[source]¶
Bases:
SQLAlchemyAsyncRepositoryService[BlogEntry, Any]Service for BlogEntry business logic.
- repository_type¶
alias of
BlogEntryRepository
- class BlogEntryUpdate[source]¶
Bases:
BaseModelSchema for updating a BlogEntry.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class BlogEntryWithFeed[source]¶
Bases:
BlogEntryReadSchema for BlogEntry with Feed information.
- model_config: ClassVar[ConfigDict] = {'from_attributes': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class BlogsPageController[source]¶
Bases:
ControllerController for blogs HTML pages.
- after_request: AfterRequestHookHandler | None¶
A sync or async function executed before a
Requestis passed to any route handler.If this function returns a value, the request will not reach the route handler, and instead this value will be used.
- after_response: AfterResponseHookHandler | None¶
A sync or async function called after the response has been awaited.
It receives the
Requestinstance and should not return any values.
- before_request: BeforeRequestHookHandler | None¶
A sync or async function called immediately before calling the route handler.
It receives the
Requestinstance and any non-Nonereturn value is used for the response, bypassing the route handler.
- cache_control: CacheControlHeader | None¶
A
CacheControlHeaderheader to add to route handlers of this controller.Can be overridden by route handlers.
- dependencies: Dependencies | None¶
A string keyed dictionary of dependency
Providerinstances.
- dto: type[AbstractDTO] | None | EmptyType¶
AbstractDTOto use for (de)serializing and validation of request data.
- etag: ETag | None¶
An
etagheader of typeETagto add to route handlers of this controller.Can be overridden by route handlers.
- exception_handlers: ExceptionHandlersMap | None¶
A map of handler functions to status codes and/or exception types.
- guards: Sequence[Guard] | None¶
A sequence of
Guardcallables.
- include_in_schema: bool | EmptyType¶
A boolean flag dictating whether the route handler should be documented in the OpenAPI schema
- middleware: Sequence[Middleware] | None¶
A sequence of
Middleware.
- opt: Mapping[str, Any] | None¶
A string key mapping of arbitrary values that can be accessed in
Guardsor wherever you have access toRequestorASGI Scope.
- owner: Router¶
The
RouterorLitestarapp that owns the controller.This value is set internally by Litestar and it should not be set when subclassing the controller.
- parameters: ParametersMap | None¶
A mapping of
Parameterdefinitions available to all application paths.
- path: str¶
A path fragment for the controller.
All route handlers under the controller will have the fragment appended to them. If not set it defaults to
/.
- request_class: type[Request] | None¶
A custom subclass of
Requestto be used as the default request for all route handlers under the controller.
- request_max_body_size: int | None | EmptyType¶
Maximum allowed size of the request body in bytes. If this size is exceeded, a ‘413 - Request Entity Too Large’ error response is returned.
- response_class: type[Response] | None¶
A custom subclass of
Responseto be used as the default response for all route handlers under the controller.
- response_cookies: ResponseCookies | None¶
A list of
Cookieinstances.
- response_headers: ResponseHeaders | None¶
A string keyed dictionary mapping
ResponseHeaderinstances.
- return_dto: type[AbstractDTO] | None | EmptyType¶
AbstractDTOto use for serializing outbound response data.
- security: Sequence[SecurityRequirement] | None¶
A sequence of dictionaries that to the schema of all route handlers under the controller.
- signature_namespace: dict[str, Any]¶
A mapping of names to types for use in forward reference resolution during signature modelling.
- signature_types: Sequence[Any]¶
A sequence of types for use in forward reference resolution during signature modelling.
These types will be added to the signature namespace using their
__name__attribute.
- tags: Sequence[str] | None¶
A sequence of string tags that will be appended to the schema of all route handlers under the controller.
- type_decoders: TypeDecodersSequence | None¶
A sequence of tuples, each composed of a predicate testing for type identity and a msgspec hook for deserialization.
- type_encoders: TypeEncodersMap | None¶
A mapping of types to callables that transform them into types supported for serialization.
- websocket_class: type[WebSocket] | None¶
A custom subclass of
WebSocketto be used as the default websocket for all route handlers under the controller.
- class BlogsPageData[source]¶
Bases:
BaseModelSchema for blogs page template data.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class Feed[source]¶
Bases:
AuditBase- __init__(**kwargs)¶
A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
- created_at: Mapped[datetime.datetime]¶
Date/time of instance creation.
- id: Mapped[UUID]¶
UUID Primary key column.
- updated_at: Mapped[datetime.datetime]¶
Date/time of instance last update.
- class FeedAggregate[source]¶
Bases:
AuditBase,NameSlugMixin- __init__(**kwargs)¶
A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
- created_at: Mapped[datetime.datetime]¶
Date/time of instance creation.
- id: Mapped[UUID]¶
UUID Primary key column.
- name: Mapped[str]¶
- slug: Mapped[str]¶
- updated_at: Mapped[datetime.datetime]¶
Date/time of instance last update.
- class FeedAggregateController[source]¶
Bases:
ControllerController for FeedAggregate CRUD operations.
- after_request: AfterRequestHookHandler | None¶
A sync or async function executed before a
Requestis passed to any route handler.If this function returns a value, the request will not reach the route handler, and instead this value will be used.
- after_response: AfterResponseHookHandler | None¶
A sync or async function called after the response has been awaited.
It receives the
Requestinstance and should not return any values.
- before_request: BeforeRequestHookHandler | None¶
A sync or async function called immediately before calling the route handler.
It receives the
Requestinstance and any non-Nonereturn value is used for the response, bypassing the route handler.
- cache_control: CacheControlHeader | None¶
A
CacheControlHeaderheader to add to route handlers of this controller.Can be overridden by route handlers.
- dependencies: Dependencies | None¶
A string keyed dictionary of dependency
Providerinstances.
- dto: type[AbstractDTO] | None | EmptyType¶
AbstractDTOto use for (de)serializing and validation of request data.
- etag: ETag | None¶
An
etagheader of typeETagto add to route handlers of this controller.Can be overridden by route handlers.
- exception_handlers: ExceptionHandlersMap | None¶
A map of handler functions to status codes and/or exception types.
- guards: Sequence[Guard] | None¶
A sequence of
Guardcallables.
- include_in_schema: bool | EmptyType¶
A boolean flag dictating whether the route handler should be documented in the OpenAPI schema
- middleware: Sequence[Middleware] | None¶
A sequence of
Middleware.
- opt: Mapping[str, Any] | None¶
A string key mapping of arbitrary values that can be accessed in
Guardsor wherever you have access toRequestorASGI Scope.
- owner: Router¶
The
RouterorLitestarapp that owns the controller.This value is set internally by Litestar and it should not be set when subclassing the controller.
- parameters: ParametersMap | None¶
A mapping of
Parameterdefinitions available to all application paths.
- path: str¶
A path fragment for the controller.
All route handlers under the controller will have the fragment appended to them. If not set it defaults to
/.
- request_class: type[Request] | None¶
A custom subclass of
Requestto be used as the default request for all route handlers under the controller.
- request_max_body_size: int | None | EmptyType¶
Maximum allowed size of the request body in bytes. If this size is exceeded, a ‘413 - Request Entity Too Large’ error response is returned.
- response_class: type[Response] | None¶
A custom subclass of
Responseto be used as the default response for all route handlers under the controller.
- response_cookies: ResponseCookies | None¶
A list of
Cookieinstances.
- response_headers: ResponseHeaders | None¶
A string keyed dictionary mapping
ResponseHeaderinstances.
- return_dto: type[AbstractDTO] | None | EmptyType¶
AbstractDTOto use for serializing outbound response data.
- security: Sequence[SecurityRequirement] | None¶
A sequence of dictionaries that to the schema of all route handlers under the controller.
- signature_namespace: dict[str, Any]¶
A mapping of names to types for use in forward reference resolution during signature modelling.
- signature_types: Sequence[Any]¶
A sequence of types for use in forward reference resolution during signature modelling.
These types will be added to the signature namespace using their
__name__attribute.
- tags: Sequence[str] | None¶
A sequence of string tags that will be appended to the schema of all route handlers under the controller.
- type_decoders: TypeDecodersSequence | None¶
A sequence of tuples, each composed of a predicate testing for type identity and a msgspec hook for deserialization.
- type_encoders: TypeEncodersMap | None¶
A mapping of types to callables that transform them into types supported for serialization.
- websocket_class: type[WebSocket] | None¶
A custom subclass of
WebSocketto be used as the default websocket for all route handlers under the controller.
- class FeedAggregateCreate[source]¶
Bases:
FeedAggregateBaseSchema for creating a new FeedAggregate.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class FeedAggregateRead[source]¶
Bases:
FeedAggregateBaseSchema for reading FeedAggregate data.
- model_config: ClassVar[ConfigDict] = {'from_attributes': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class FeedAggregateRepository[source]¶
Bases:
SQLAlchemyAsyncRepository[FeedAggregate]Repository for FeedAggregate database operations.
- async get_by_slug(slug)[source]¶
Get a feed aggregate by slug.
- Parameters:
slug (
str) – The slug to search for.- Return type:
- Returns:
The feed aggregate if found, None otherwise.
- model_type¶
alias of
FeedAggregate
- class FeedAggregateService[source]¶
Bases:
SQLAlchemyAsyncRepositoryService[FeedAggregate, Any]Service for FeedAggregate business logic.
- async get_by_slug(slug)[source]¶
Get a feed aggregate by slug.
- Parameters:
slug (
str) – The slug to search for.- Return type:
- Returns:
The feed aggregate if found, None otherwise.
- async get_entries_for_aggregate(aggregate_id, limit=100)[source]¶
Get all entries for a feed aggregate.
- match_fields: ClassVar[Optional[Union[list[str], str]]] = ['slug']¶
List of dialects that prefer to use
field.id = ANY(:1)instead offield.id IN (...).
- repository_type¶
alias of
FeedAggregateRepository
- class FeedAggregateUpdate[source]¶
Bases:
BaseModelSchema for updating a FeedAggregate.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class FeedAggregateWithFeeds[source]¶
Bases:
FeedAggregateReadSchema for FeedAggregate with Feeds.
- model_config: ClassVar[ConfigDict] = {'from_attributes': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class FeedController[source]¶
Bases:
ControllerController for Feed CRUD operations.
- after_request: AfterRequestHookHandler | None¶
A sync or async function executed before a
Requestis passed to any route handler.If this function returns a value, the request will not reach the route handler, and instead this value will be used.
- after_response: AfterResponseHookHandler | None¶
A sync or async function called after the response has been awaited.
It receives the
Requestinstance and should not return any values.
- before_request: BeforeRequestHookHandler | None¶
A sync or async function called immediately before calling the route handler.
It receives the
Requestinstance and any non-Nonereturn value is used for the response, bypassing the route handler.
- cache_control: CacheControlHeader | None¶
A
CacheControlHeaderheader to add to route handlers of this controller.Can be overridden by route handlers.
- dependencies: Dependencies | None¶
A string keyed dictionary of dependency
Providerinstances.
- dto: type[AbstractDTO] | None | EmptyType¶
AbstractDTOto use for (de)serializing and validation of request data.
- etag: ETag | None¶
An
etagheader of typeETagto add to route handlers of this controller.Can be overridden by route handlers.
- exception_handlers: ExceptionHandlersMap | None¶
A map of handler functions to status codes and/or exception types.
- guards: Sequence[Guard] | None¶
A sequence of
Guardcallables.
- include_in_schema: bool | EmptyType¶
A boolean flag dictating whether the route handler should be documented in the OpenAPI schema
- middleware: Sequence[Middleware] | None¶
A sequence of
Middleware.
- opt: Mapping[str, Any] | None¶
A string key mapping of arbitrary values that can be accessed in
Guardsor wherever you have access toRequestorASGI Scope.
- owner: Router¶
The
RouterorLitestarapp that owns the controller.This value is set internally by Litestar and it should not be set when subclassing the controller.
- parameters: ParametersMap | None¶
A mapping of
Parameterdefinitions available to all application paths.
- path: str¶
A path fragment for the controller.
All route handlers under the controller will have the fragment appended to them. If not set it defaults to
/.
- request_class: type[Request] | None¶
A custom subclass of
Requestto be used as the default request for all route handlers under the controller.
- request_max_body_size: int | None | EmptyType¶
Maximum allowed size of the request body in bytes. If this size is exceeded, a ‘413 - Request Entity Too Large’ error response is returned.
- response_class: type[Response] | None¶
A custom subclass of
Responseto be used as the default response for all route handlers under the controller.
- response_cookies: ResponseCookies | None¶
A list of
Cookieinstances.
- response_headers: ResponseHeaders | None¶
A string keyed dictionary mapping
ResponseHeaderinstances.
- return_dto: type[AbstractDTO] | None | EmptyType¶
AbstractDTOto use for serializing outbound response data.
- security: Sequence[SecurityRequirement] | None¶
A sequence of dictionaries that to the schema of all route handlers under the controller.
- signature_namespace: dict[str, Any]¶
A mapping of names to types for use in forward reference resolution during signature modelling.
- signature_types: Sequence[Any]¶
A sequence of types for use in forward reference resolution during signature modelling.
These types will be added to the signature namespace using their
__name__attribute.
- tags: Sequence[str] | None¶
A sequence of string tags that will be appended to the schema of all route handlers under the controller.
- type_decoders: TypeDecodersSequence | None¶
A sequence of tuples, each composed of a predicate testing for type identity and a msgspec hook for deserialization.
- type_encoders: TypeEncodersMap | None¶
A mapping of types to callables that transform them into types supported for serialization.
- websocket_class: type[WebSocket] | None¶
A custom subclass of
WebSocketto be used as the default websocket for all route handlers under the controller.
- class FeedCreate[source]¶
Bases:
FeedBaseSchema for creating a new Feed.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class FeedDetailPageData[source]¶
Bases:
BaseModelSchema for feed detail page template data.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class FeedList[source]¶
Bases:
BaseModelSchema for Feed list items.
- model_config: ClassVar[ConfigDict] = {'from_attributes': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class FeedRead[source]¶
Bases:
FeedBaseSchema for reading Feed data.
- model_config: ClassVar[ConfigDict] = {'from_attributes': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class FeedRepository[source]¶
Bases:
SQLAlchemyAsyncRepository[Feed]Repository for Feed database operations.
- class FeedService[source]¶
Bases:
SQLAlchemyAsyncRepositoryService[Feed, Any]Service for Feed business logic.
- repository_type¶
alias of
FeedRepository
- class FeedUpdate[source]¶
Bases:
BaseModelSchema for updating a Feed.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class RelatedBlog[source]¶
Bases:
AuditBase- __init__(**kwargs)¶
A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
- created_at: Mapped[datetime.datetime]¶
Date/time of instance creation.
- id: Mapped[UUID]¶
UUID Primary key column.
- updated_at: Mapped[datetime.datetime]¶
Date/time of instance last update.
- class RelatedBlogController[source]¶
Bases:
ControllerController for RelatedBlog CRUD operations.
- after_request: AfterRequestHookHandler | None¶
A sync or async function executed before a
Requestis passed to any route handler.If this function returns a value, the request will not reach the route handler, and instead this value will be used.
- after_response: AfterResponseHookHandler | None¶
A sync or async function called after the response has been awaited.
It receives the
Requestinstance and should not return any values.
- before_request: BeforeRequestHookHandler | None¶
A sync or async function called immediately before calling the route handler.
It receives the
Requestinstance and any non-Nonereturn value is used for the response, bypassing the route handler.
- cache_control: CacheControlHeader | None¶
A
CacheControlHeaderheader to add to route handlers of this controller.Can be overridden by route handlers.
- dependencies: Dependencies | None¶
A string keyed dictionary of dependency
Providerinstances.
- dto: type[AbstractDTO] | None | EmptyType¶
AbstractDTOto use for (de)serializing and validation of request data.
- etag: ETag | None¶
An
etagheader of typeETagto add to route handlers of this controller.Can be overridden by route handlers.
- exception_handlers: ExceptionHandlersMap | None¶
A map of handler functions to status codes and/or exception types.
- guards: Sequence[Guard] | None¶
A sequence of
Guardcallables.
- include_in_schema: bool | EmptyType¶
A boolean flag dictating whether the route handler should be documented in the OpenAPI schema
- middleware: Sequence[Middleware] | None¶
A sequence of
Middleware.
- opt: Mapping[str, Any] | None¶
A string key mapping of arbitrary values that can be accessed in
Guardsor wherever you have access toRequestorASGI Scope.
- owner: Router¶
The
RouterorLitestarapp that owns the controller.This value is set internally by Litestar and it should not be set when subclassing the controller.
- parameters: ParametersMap | None¶
A mapping of
Parameterdefinitions available to all application paths.
- path: str¶
A path fragment for the controller.
All route handlers under the controller will have the fragment appended to them. If not set it defaults to
/.
- request_class: type[Request] | None¶
A custom subclass of
Requestto be used as the default request for all route handlers under the controller.
- request_max_body_size: int | None | EmptyType¶
Maximum allowed size of the request body in bytes. If this size is exceeded, a ‘413 - Request Entity Too Large’ error response is returned.
- response_class: type[Response] | None¶
A custom subclass of
Responseto be used as the default response for all route handlers under the controller.
- response_cookies: ResponseCookies | None¶
A list of
Cookieinstances.
- response_headers: ResponseHeaders | None¶
A string keyed dictionary mapping
ResponseHeaderinstances.
- return_dto: type[AbstractDTO] | None | EmptyType¶
AbstractDTOto use for serializing outbound response data.
- security: Sequence[SecurityRequirement] | None¶
A sequence of dictionaries that to the schema of all route handlers under the controller.
- signature_namespace: dict[str, Any]¶
A mapping of names to types for use in forward reference resolution during signature modelling.
- signature_types: Sequence[Any]¶
A sequence of types for use in forward reference resolution during signature modelling.
These types will be added to the signature namespace using their
__name__attribute.
- tags: Sequence[str] | None¶
A sequence of string tags that will be appended to the schema of all route handlers under the controller.
- type_decoders: TypeDecodersSequence | None¶
A sequence of tuples, each composed of a predicate testing for type identity and a msgspec hook for deserialization.
- type_encoders: TypeEncodersMap | None¶
A mapping of types to callables that transform them into types supported for serialization.
- websocket_class: type[WebSocket] | None¶
A custom subclass of
WebSocketto be used as the default websocket for all route handlers under the controller.
- class RelatedBlogCreate[source]¶
Bases:
RelatedBlogBaseSchema for creating a new RelatedBlog.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class RelatedBlogRead[source]¶
Bases:
RelatedBlogBaseSchema for reading RelatedBlog data.
- model_config: ClassVar[ConfigDict] = {'from_attributes': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class RelatedBlogRepository[source]¶
Bases:
SQLAlchemyAsyncRepository[RelatedBlog]Repository for RelatedBlog database operations.
- async get_all_active(limit=100)[source]¶
Get all related blogs.
- Parameters:
limit (
int) – Maximum number of blogs to return.- Return type:
- Returns:
List of related blogs ordered by blog name.
- model_type¶
alias of
RelatedBlog
- class RelatedBlogService[source]¶
Bases:
SQLAlchemyAsyncRepositoryService[RelatedBlog, Any]Service for RelatedBlog business logic.
- async get_all_active(limit=100)[source]¶
Get all related blogs.
- Parameters:
limit (
int) – Maximum number of blogs to return.- Return type:
- Returns:
List of related blogs.
- repository_type¶
alias of
RelatedBlogRepository
- class RelatedBlogUpdate[source]¶
Bases:
BaseModelSchema for updating a RelatedBlog.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
models¶
Blogs domain models.
- class Feed[source]¶
Bases:
AuditBase- __init__(**kwargs)¶
A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
- created_at: Mapped[datetime.datetime]¶
Date/time of instance creation.
- id: Mapped[UUID]¶
UUID Primary key column.
- updated_at: Mapped[datetime.datetime]¶
Date/time of instance last update.
- class BlogEntry[source]¶
Bases:
AuditBase- __init__(**kwargs)¶
A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
- created_at: Mapped[datetime.datetime]¶
Date/time of instance creation.
- id: Mapped[UUID]¶
UUID Primary key column.
- updated_at: Mapped[datetime.datetime]¶
Date/time of instance last update.
- class FeedAggregate[source]¶
Bases:
AuditBase,NameSlugMixin- __init__(**kwargs)¶
A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
- created_at: Mapped[datetime.datetime]¶
Date/time of instance creation.
- id: Mapped[UUID]¶
UUID Primary key column.
- name: Mapped[str]¶
- slug: Mapped[str]¶
- updated_at: Mapped[datetime.datetime]¶
Date/time of instance last update.
- class RelatedBlog[source]¶
Bases:
AuditBase- __init__(**kwargs)¶
A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
- created_at: Mapped[datetime.datetime]¶
Date/time of instance creation.
- id: Mapped[UUID]¶
UUID Primary key column.
- updated_at: Mapped[datetime.datetime]¶
Date/time of instance last update.
schemas¶
Blogs domain Pydantic schemas.
- class FeedBase[source]¶
Bases:
BaseModelBase Feed schema with common fields.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class FeedCreate[source]¶
Bases:
FeedBaseSchema for creating a new Feed.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class FeedUpdate[source]¶
Bases:
BaseModelSchema for updating a Feed.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class FeedRead[source]¶
Bases:
FeedBaseSchema for reading Feed data.
- model_config: ClassVar[ConfigDict] = {'from_attributes': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class FeedList[source]¶
Bases:
BaseModelSchema for Feed list items.
- model_config: ClassVar[ConfigDict] = {'from_attributes': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class BlogEntryBase[source]¶
Bases:
BaseModelBase BlogEntry schema with common fields.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class BlogEntryCreate[source]¶
Bases:
BlogEntryBaseSchema for creating a new BlogEntry.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class BlogEntryUpdate[source]¶
Bases:
BaseModelSchema for updating a BlogEntry.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class BlogEntryRead[source]¶
Bases:
BlogEntryBaseSchema for reading BlogEntry data.
- model_config: ClassVar[ConfigDict] = {'from_attributes': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class BlogEntryList[source]¶
Bases:
BaseModelSchema for BlogEntry list items.
- model_config: ClassVar[ConfigDict] = {'from_attributes': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class BlogEntryWithFeed[source]¶
Bases:
BlogEntryReadSchema for BlogEntry with Feed information.
- model_config: ClassVar[ConfigDict] = {'from_attributes': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class FeedAggregateBase[source]¶
Bases:
BaseModelBase FeedAggregate schema with common fields.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class FeedAggregateCreate[source]¶
Bases:
FeedAggregateBaseSchema for creating a new FeedAggregate.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class FeedAggregateUpdate[source]¶
Bases:
BaseModelSchema for updating a FeedAggregate.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class FeedAggregateRead[source]¶
Bases:
FeedAggregateBaseSchema for reading FeedAggregate data.
- model_config: ClassVar[ConfigDict] = {'from_attributes': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class FeedAggregateWithFeeds[source]¶
Bases:
FeedAggregateReadSchema for FeedAggregate with Feeds.
- model_config: ClassVar[ConfigDict] = {'from_attributes': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class RelatedBlogBase[source]¶
Bases:
BaseModelBase RelatedBlog schema with common fields.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class RelatedBlogCreate[source]¶
Bases:
RelatedBlogBaseSchema for creating a new RelatedBlog.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class RelatedBlogUpdate[source]¶
Bases:
BaseModelSchema for updating a RelatedBlog.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class RelatedBlogRead[source]¶
Bases:
RelatedBlogBaseSchema for reading RelatedBlog data.
- model_config: ClassVar[ConfigDict] = {'from_attributes': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
services¶
Blogs domain services for business logic.
- class FeedService[source]¶
Bases:
SQLAlchemyAsyncRepositoryService[Feed, Any]Service for Feed business logic.
- repository_type¶
alias of
FeedRepository
- class BlogEntryService[source]¶
Bases:
SQLAlchemyAsyncRepositoryService[BlogEntry, Any]Service for BlogEntry business logic.
- repository_type¶
alias of
BlogEntryRepository
- class FeedAggregateService[source]¶
Bases:
SQLAlchemyAsyncRepositoryService[FeedAggregate, Any]Service for FeedAggregate business logic.
- repository_type¶
alias of
FeedAggregateRepository
- match_fields: ClassVar[Optional[Union[list[str], str]]] = ['slug']¶
List of dialects that prefer to use
field.id = ANY(:1)instead offield.id IN (...).
- async get_by_slug(slug)[source]¶
Get a feed aggregate by slug.
- Parameters:
slug (
str) – The slug to search for.- Return type:
- Returns:
The feed aggregate if found, None otherwise.
- class RelatedBlogService[source]¶
Bases:
SQLAlchemyAsyncRepositoryService[RelatedBlog, Any]Service for RelatedBlog business logic.
- repository_type¶
alias of
RelatedBlogRepository
controllers¶
Blogs domain API and page controllers.
- class FeedController[source]¶
Bases:
ControllerController for Feed CRUD operations.
- path: str¶
A path fragment for the controller.
All route handlers under the controller will have the fragment appended to them. If not set it defaults to
/.
- tags: Sequence[str] | None¶
A sequence of string tags that will be appended to the schema of all route handlers under the controller.
- after_request: AfterRequestHookHandler | None¶
A sync or async function executed before a
Requestis passed to any route handler.If this function returns a value, the request will not reach the route handler, and instead this value will be used.
- after_response: AfterResponseHookHandler | None¶
A sync or async function called after the response has been awaited.
It receives the
Requestinstance and should not return any values.
- before_request: BeforeRequestHookHandler | None¶
A sync or async function called immediately before calling the route handler.
It receives the
Requestinstance and any non-Nonereturn value is used for the response, bypassing the route handler.
- cache_control: CacheControlHeader | None¶
A
CacheControlHeaderheader to add to route handlers of this controller.Can be overridden by route handlers.
- dependencies: Dependencies | None¶
A string keyed dictionary of dependency
Providerinstances.
- dto: type[AbstractDTO] | None | EmptyType¶
AbstractDTOto use for (de)serializing and validation of request data.
- etag: ETag | None¶
An
etagheader of typeETagto add to route handlers of this controller.Can be overridden by route handlers.
- exception_handlers: ExceptionHandlersMap | None¶
A map of handler functions to status codes and/or exception types.
- guards: Sequence[Guard] | None¶
A sequence of
Guardcallables.
- include_in_schema: bool | EmptyType¶
A boolean flag dictating whether the route handler should be documented in the OpenAPI schema
- middleware: Sequence[Middleware] | None¶
A sequence of
Middleware.
- opt: Mapping[str, Any] | None¶
A string key mapping of arbitrary values that can be accessed in
Guardsor wherever you have access toRequestorASGI Scope.
- owner: Router¶
The
RouterorLitestarapp that owns the controller.This value is set internally by Litestar and it should not be set when subclassing the controller.
- parameters: ParametersMap | None¶
A mapping of
Parameterdefinitions available to all application paths.
- request_class: type[Request] | None¶
A custom subclass of
Requestto be used as the default request for all route handlers under the controller.
- request_max_body_size: int | None | EmptyType¶
Maximum allowed size of the request body in bytes. If this size is exceeded, a ‘413 - Request Entity Too Large’ error response is returned.
- response_class: type[Response] | None¶
A custom subclass of
Responseto be used as the default response for all route handlers under the controller.
- response_cookies: ResponseCookies | None¶
A list of
Cookieinstances.
- response_headers: ResponseHeaders | None¶
A string keyed dictionary mapping
ResponseHeaderinstances.
- return_dto: type[AbstractDTO] | None | EmptyType¶
AbstractDTOto use for serializing outbound response data.
- security: Sequence[SecurityRequirement] | None¶
A sequence of dictionaries that to the schema of all route handlers under the controller.
- signature_namespace: dict[str, Any]¶
A mapping of names to types for use in forward reference resolution during signature modelling.
- signature_types: Sequence[Any]¶
A sequence of types for use in forward reference resolution during signature modelling.
These types will be added to the signature namespace using their
__name__attribute.
- type_decoders: TypeDecodersSequence | None¶
A sequence of tuples, each composed of a predicate testing for type identity and a msgspec hook for deserialization.
- type_encoders: TypeEncodersMap | None¶
A mapping of types to callables that transform them into types supported for serialization.
- websocket_class: type[WebSocket] | None¶
A custom subclass of
WebSocketto be used as the default websocket for all route handlers under the controller.
- class BlogEntryController[source]¶
Bases:
ControllerController for BlogEntry CRUD operations.
- path: str¶
A path fragment for the controller.
All route handlers under the controller will have the fragment appended to them. If not set it defaults to
/.
- tags: Sequence[str] | None¶
A sequence of string tags that will be appended to the schema of all route handlers under the controller.
- after_request: AfterRequestHookHandler | None¶
A sync or async function executed before a
Requestis passed to any route handler.If this function returns a value, the request will not reach the route handler, and instead this value will be used.
- after_response: AfterResponseHookHandler | None¶
A sync or async function called after the response has been awaited.
It receives the
Requestinstance and should not return any values.
- before_request: BeforeRequestHookHandler | None¶
A sync or async function called immediately before calling the route handler.
It receives the
Requestinstance and any non-Nonereturn value is used for the response, bypassing the route handler.
- cache_control: CacheControlHeader | None¶
A
CacheControlHeaderheader to add to route handlers of this controller.Can be overridden by route handlers.
- dependencies: Dependencies | None¶
A string keyed dictionary of dependency
Providerinstances.
- dto: type[AbstractDTO] | None | EmptyType¶
AbstractDTOto use for (de)serializing and validation of request data.
- etag: ETag | None¶
An
etagheader of typeETagto add to route handlers of this controller.Can be overridden by route handlers.
- exception_handlers: ExceptionHandlersMap | None¶
A map of handler functions to status codes and/or exception types.
- guards: Sequence[Guard] | None¶
A sequence of
Guardcallables.
- include_in_schema: bool | EmptyType¶
A boolean flag dictating whether the route handler should be documented in the OpenAPI schema
- middleware: Sequence[Middleware] | None¶
A sequence of
Middleware.
- opt: Mapping[str, Any] | None¶
A string key mapping of arbitrary values that can be accessed in
Guardsor wherever you have access toRequestorASGI Scope.
- owner: Router¶
The
RouterorLitestarapp that owns the controller.This value is set internally by Litestar and it should not be set when subclassing the controller.
- parameters: ParametersMap | None¶
A mapping of
Parameterdefinitions available to all application paths.
- request_class: type[Request] | None¶
A custom subclass of
Requestto be used as the default request for all route handlers under the controller.
- request_max_body_size: int | None | EmptyType¶
Maximum allowed size of the request body in bytes. If this size is exceeded, a ‘413 - Request Entity Too Large’ error response is returned.
- response_class: type[Response] | None¶
A custom subclass of
Responseto be used as the default response for all route handlers under the controller.
- response_cookies: ResponseCookies | None¶
A list of
Cookieinstances.
- response_headers: ResponseHeaders | None¶
A string keyed dictionary mapping
ResponseHeaderinstances.
- return_dto: type[AbstractDTO] | None | EmptyType¶
AbstractDTOto use for serializing outbound response data.
- security: Sequence[SecurityRequirement] | None¶
A sequence of dictionaries that to the schema of all route handlers under the controller.
- signature_namespace: dict[str, Any]¶
A mapping of names to types for use in forward reference resolution during signature modelling.
- signature_types: Sequence[Any]¶
A sequence of types for use in forward reference resolution during signature modelling.
These types will be added to the signature namespace using their
__name__attribute.
- type_decoders: TypeDecodersSequence | None¶
A sequence of tuples, each composed of a predicate testing for type identity and a msgspec hook for deserialization.
- type_encoders: TypeEncodersMap | None¶
A mapping of types to callables that transform them into types supported for serialization.
- websocket_class: type[WebSocket] | None¶
A custom subclass of
WebSocketto be used as the default websocket for all route handlers under the controller.
- class FeedAggregateController[source]¶
Bases:
ControllerController for FeedAggregate CRUD operations.
- path: str¶
A path fragment for the controller.
All route handlers under the controller will have the fragment appended to them. If not set it defaults to
/.
- tags: Sequence[str] | None¶
A sequence of string tags that will be appended to the schema of all route handlers under the controller.
- after_request: AfterRequestHookHandler | None¶
A sync or async function executed before a
Requestis passed to any route handler.If this function returns a value, the request will not reach the route handler, and instead this value will be used.
- after_response: AfterResponseHookHandler | None¶
A sync or async function called after the response has been awaited.
It receives the
Requestinstance and should not return any values.
- before_request: BeforeRequestHookHandler | None¶
A sync or async function called immediately before calling the route handler.
It receives the
Requestinstance and any non-Nonereturn value is used for the response, bypassing the route handler.
- cache_control: CacheControlHeader | None¶
A
CacheControlHeaderheader to add to route handlers of this controller.Can be overridden by route handlers.
- dependencies: Dependencies | None¶
A string keyed dictionary of dependency
Providerinstances.
- dto: type[AbstractDTO] | None | EmptyType¶
AbstractDTOto use for (de)serializing and validation of request data.
- etag: ETag | None¶
An
etagheader of typeETagto add to route handlers of this controller.Can be overridden by route handlers.
- exception_handlers: ExceptionHandlersMap | None¶
A map of handler functions to status codes and/or exception types.
- guards: Sequence[Guard] | None¶
A sequence of
Guardcallables.
- include_in_schema: bool | EmptyType¶
A boolean flag dictating whether the route handler should be documented in the OpenAPI schema
- middleware: Sequence[Middleware] | None¶
A sequence of
Middleware.
- opt: Mapping[str, Any] | None¶
A string key mapping of arbitrary values that can be accessed in
Guardsor wherever you have access toRequestorASGI Scope.
- owner: Router¶
The
RouterorLitestarapp that owns the controller.This value is set internally by Litestar and it should not be set when subclassing the controller.
- parameters: ParametersMap | None¶
A mapping of
Parameterdefinitions available to all application paths.
- request_class: type[Request] | None¶
A custom subclass of
Requestto be used as the default request for all route handlers under the controller.
- request_max_body_size: int | None | EmptyType¶
Maximum allowed size of the request body in bytes. If this size is exceeded, a ‘413 - Request Entity Too Large’ error response is returned.
- response_class: type[Response] | None¶
A custom subclass of
Responseto be used as the default response for all route handlers under the controller.
- response_cookies: ResponseCookies | None¶
A list of
Cookieinstances.
- response_headers: ResponseHeaders | None¶
A string keyed dictionary mapping
ResponseHeaderinstances.
- return_dto: type[AbstractDTO] | None | EmptyType¶
AbstractDTOto use for serializing outbound response data.
- security: Sequence[SecurityRequirement] | None¶
A sequence of dictionaries that to the schema of all route handlers under the controller.
- signature_namespace: dict[str, Any]¶
A mapping of names to types for use in forward reference resolution during signature modelling.
- signature_types: Sequence[Any]¶
A sequence of types for use in forward reference resolution during signature modelling.
These types will be added to the signature namespace using their
__name__attribute.
- type_decoders: TypeDecodersSequence | None¶
A sequence of tuples, each composed of a predicate testing for type identity and a msgspec hook for deserialization.
- type_encoders: TypeEncodersMap | None¶
A mapping of types to callables that transform them into types supported for serialization.
- websocket_class: type[WebSocket] | None¶
A custom subclass of
WebSocketto be used as the default websocket for all route handlers under the controller.
- class RelatedBlogController[source]¶
Bases:
ControllerController for RelatedBlog CRUD operations.
- path: str¶
A path fragment for the controller.
All route handlers under the controller will have the fragment appended to them. If not set it defaults to
/.
- tags: Sequence[str] | None¶
A sequence of string tags that will be appended to the schema of all route handlers under the controller.
- after_request: AfterRequestHookHandler | None¶
A sync or async function executed before a
Requestis passed to any route handler.If this function returns a value, the request will not reach the route handler, and instead this value will be used.
- after_response: AfterResponseHookHandler | None¶
A sync or async function called after the response has been awaited.
It receives the
Requestinstance and should not return any values.
- before_request: BeforeRequestHookHandler | None¶
A sync or async function called immediately before calling the route handler.
It receives the
Requestinstance and any non-Nonereturn value is used for the response, bypassing the route handler.
- cache_control: CacheControlHeader | None¶
A
CacheControlHeaderheader to add to route handlers of this controller.Can be overridden by route handlers.
- dependencies: Dependencies | None¶
A string keyed dictionary of dependency
Providerinstances.
- dto: type[AbstractDTO] | None | EmptyType¶
AbstractDTOto use for (de)serializing and validation of request data.
- etag: ETag | None¶
An
etagheader of typeETagto add to route handlers of this controller.Can be overridden by route handlers.
- exception_handlers: ExceptionHandlersMap | None¶
A map of handler functions to status codes and/or exception types.
- guards: Sequence[Guard] | None¶
A sequence of
Guardcallables.
- include_in_schema: bool | EmptyType¶
A boolean flag dictating whether the route handler should be documented in the OpenAPI schema
- middleware: Sequence[Middleware] | None¶
A sequence of
Middleware.
- opt: Mapping[str, Any] | None¶
A string key mapping of arbitrary values that can be accessed in
Guardsor wherever you have access toRequestorASGI Scope.
- owner: Router¶
The
RouterorLitestarapp that owns the controller.This value is set internally by Litestar and it should not be set when subclassing the controller.
- parameters: ParametersMap | None¶
A mapping of
Parameterdefinitions available to all application paths.
- request_class: type[Request] | None¶
A custom subclass of
Requestto be used as the default request for all route handlers under the controller.
- request_max_body_size: int | None | EmptyType¶
Maximum allowed size of the request body in bytes. If this size is exceeded, a ‘413 - Request Entity Too Large’ error response is returned.
- response_class: type[Response] | None¶
A custom subclass of
Responseto be used as the default response for all route handlers under the controller.
- response_cookies: ResponseCookies | None¶
A list of
Cookieinstances.
- response_headers: ResponseHeaders | None¶
A string keyed dictionary mapping
ResponseHeaderinstances.
- return_dto: type[AbstractDTO] | None | EmptyType¶
AbstractDTOto use for serializing outbound response data.
- security: Sequence[SecurityRequirement] | None¶
A sequence of dictionaries that to the schema of all route handlers under the controller.
- signature_namespace: dict[str, Any]¶
A mapping of names to types for use in forward reference resolution during signature modelling.
- signature_types: Sequence[Any]¶
A sequence of types for use in forward reference resolution during signature modelling.
These types will be added to the signature namespace using their
__name__attribute.
- type_decoders: TypeDecodersSequence | None¶
A sequence of tuples, each composed of a predicate testing for type identity and a msgspec hook for deserialization.
- type_encoders: TypeEncodersMap | None¶
A mapping of types to callables that transform them into types supported for serialization.
- websocket_class: type[WebSocket] | None¶
A custom subclass of
WebSocketto be used as the default websocket for all route handlers under the controller.
- class BlogsPageController[source]¶
Bases:
ControllerController for blogs HTML pages.
- path: str¶
A path fragment for the controller.
All route handlers under the controller will have the fragment appended to them. If not set it defaults to
/.
- include_in_schema: bool | EmptyType¶
A boolean flag dictating whether the route handler should be documented in the OpenAPI schema
- after_request: AfterRequestHookHandler | None¶
A sync or async function executed before a
Requestis passed to any route handler.If this function returns a value, the request will not reach the route handler, and instead this value will be used.
- after_response: AfterResponseHookHandler | None¶
A sync or async function called after the response has been awaited.
It receives the
Requestinstance and should not return any values.
- before_request: BeforeRequestHookHandler | None¶
A sync or async function called immediately before calling the route handler.
It receives the
Requestinstance and any non-Nonereturn value is used for the response, bypassing the route handler.
- cache_control: CacheControlHeader | None¶
A
CacheControlHeaderheader to add to route handlers of this controller.Can be overridden by route handlers.
- dependencies: Dependencies | None¶
A string keyed dictionary of dependency
Providerinstances.
- dto: type[AbstractDTO] | None | EmptyType¶
AbstractDTOto use for (de)serializing and validation of request data.
- etag: ETag | None¶
An
etagheader of typeETagto add to route handlers of this controller.Can be overridden by route handlers.
- exception_handlers: ExceptionHandlersMap | None¶
A map of handler functions to status codes and/or exception types.
- guards: Sequence[Guard] | None¶
A sequence of
Guardcallables.
- middleware: Sequence[Middleware] | None¶
A sequence of
Middleware.
- opt: Mapping[str, Any] | None¶
A string key mapping of arbitrary values that can be accessed in
Guardsor wherever you have access toRequestorASGI Scope.
- owner: Router¶
The
RouterorLitestarapp that owns the controller.This value is set internally by Litestar and it should not be set when subclassing the controller.
- parameters: ParametersMap | None¶
A mapping of
Parameterdefinitions available to all application paths.
- request_class: type[Request] | None¶
A custom subclass of
Requestto be used as the default request for all route handlers under the controller.
- request_max_body_size: int | None | EmptyType¶
Maximum allowed size of the request body in bytes. If this size is exceeded, a ‘413 - Request Entity Too Large’ error response is returned.
- response_class: type[Response] | None¶
A custom subclass of
Responseto be used as the default response for all route handlers under the controller.
- response_cookies: ResponseCookies | None¶
A list of
Cookieinstances.
- response_headers: ResponseHeaders | None¶
A string keyed dictionary mapping
ResponseHeaderinstances.
- return_dto: type[AbstractDTO] | None | EmptyType¶
AbstractDTOto use for serializing outbound response data.
- security: Sequence[SecurityRequirement] | None¶
A sequence of dictionaries that to the schema of all route handlers under the controller.
- signature_namespace: dict[str, Any]¶
A mapping of names to types for use in forward reference resolution during signature modelling.
- signature_types: Sequence[Any]¶
A sequence of types for use in forward reference resolution during signature modelling.
These types will be added to the signature namespace using their
__name__attribute.
- tags: Sequence[str] | None¶
A sequence of string tags that will be appended to the schema of all route handlers under the controller.
- type_decoders: TypeDecodersSequence | None¶
A sequence of tuples, each composed of a predicate testing for type identity and a msgspec hook for deserialization.
- type_encoders: TypeEncodersMap | None¶
A mapping of types to callables that transform them into types supported for serialization.
- websocket_class: type[WebSocket] | None¶
A custom subclass of
WebSocketto be used as the default websocket for all route handlers under the controller.
repositories¶
Blogs domain repositories for database access.
- class FeedRepository[source]¶
Bases:
SQLAlchemyAsyncRepository[Feed]Repository for Feed database operations.
- class BlogEntryRepository[source]¶
Bases:
SQLAlchemyAsyncRepository[BlogEntry]Repository for BlogEntry database operations.
- async get_recent_entries(limit=20, offset=0)[source]¶
Get recent blog entries across all feeds.
Entries are ordered by publication date, with entries from higher-priority feeds (e.g., official Python blogs) appearing first when dates are similar.
- class FeedAggregateRepository[source]¶
Bases:
SQLAlchemyAsyncRepository[FeedAggregate]Repository for FeedAggregate database operations.
- model_type¶
alias of
FeedAggregate
- class RelatedBlogRepository[source]¶
Bases:
SQLAlchemyAsyncRepository[RelatedBlog]Repository for RelatedBlog database operations.
- model_type¶
alias of
RelatedBlog