Route-level contract declaration types.
contracts.declarations
| Name | Type | Default | Description |
|---|---|---|---|
type
|
|
— | |
qualified_name
|
|
— | |
element_type
|
|
— | |
description
|
|
— | |
source_file
|
|
— | |
line_number
|
|
— | |
is_autodoc
|
|
— | |
autodoc_element
|
|
— | |
_autodoc_template
|
|
— | |
_autodoc_url_path
|
|
— | |
_autodoc_page_type
|
|
— | |
title
|
|
— | |
doc_content_hash
|
|
— |
Symbols on this page
class
FragmentContract
class
SSEContract
class
FormContract
class
RouteContract
function
contract
Declares that a route returns a specific template fragment.
Declares event types and optional fragments emitted by an SSE route.
Declares which dataclass a route binds form data to.
Full contract metadata for a route.
Attach a RouteContract to a route handler.
FragmentContract
class
Declares that a route returns a specific template fragment.
SSEContract
class
Declares event types and optional fragments emitted by an SSE route.
FormContract
class
Declares which dataclass a route binds form data to.
RouteContract
class
Full contract metadata for a route.
contract
function
def contract(returns: FragmentContract | SSEContract | None = None, *, form: FormContract | None = None, description: str = '') -> Any
Attach a RouteContract to a route handler.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
returns
|
FragmentContract | SSEContract | None
|
None
|
|
form
|
FormContract | None
|
None
|
|
description
|
str
|
''
|
View source · /home/runner/work/chirp/chirp/site/../src/chirp/contracts/declarations.py:1