adhocracy_core.rest.schemas module¶
Data structures / validation specific to rest api requests.
-
validate_request_data(schema_class: object) → <built-in function callable>[source]¶ Decorator for view to validate request with schema.
-
validate_visibility(view: <built-in function callable>)[source]¶ Decorator for view to check if context is visible.
Raises: HTTPGone – if context is hidden and request method is GET, HEAD, or POST.
-
class
UpdatedResourcesSchema(*arg, **kw)[source]¶ Bases:
adhocracy_core.schema.MappingSchemaList the resources affected by a transaction.
-
class
ResourceResponseSchema(*arg, **kw)[source]¶ Bases:
adhocracy_core.schema.ResourcePathSchemaData structure for responses of Resource requests.
-
class
DELETEResourceResponseSchema(*arg, **kw)[source]¶ Bases:
adhocracy_core.schema.MappingSchemaData structure for Resource Delete requests.
-
class
ItemResponseSchema(*arg, **kw)[source]¶ Bases:
adhocracy_core.rest.schemas.ResourceResponseSchemaData structure for responses of IItem requests.
-
class
GETResourceResponseSchema(*arg, **kw)[source]¶ Bases:
adhocracy_core.schema.ResourcePathAndContentSchemaData structure for Resource GET requests.
-
class
GETItemResponseSchema(*arg, **kw)[source]¶ Bases:
adhocracy_core.schema.ResourcePathAndContentSchemaData structure for responses of IItem requests.
-
add_put_data_subschemas(node: adhocracy_core.schema.MappingSchema, kw: dict)[source]¶ Add the resource sheet schemas that are ‘editable’.
-
class
BlockExplanationResponseSchema(*arg, **kw)[source]¶ Bases:
adhocracy_core.schema.MappingSchemaData structure explaining a 410 Gone response.
-
class
PUTResourceRequestSchema(*arg, **kw)[source]¶ Bases:
adhocracy_core.schema.MappingSchemaData structure for Resource PUT requests.
The subschemas for the Resource Sheets
-
add_post_data_subschemas(node: adhocracy_core.schema.SchemaNode, kw: dict)[source]¶ Add the resource sheet schemas that are ‘creatable’.
-
class
POSTResourceRequestSchema(*arg, **kw)[source]¶ Bases:
adhocracy_core.rest.schemas.PUTResourceRequestSchemaData structure for Resource POST requests.
-
class
AbsolutePaths(*args, **kw)[source]¶ Bases:
adhocracy_core.schema.SequenceSchemaList of resource paths.
-
validate_root_versions(node: adhocracy_core.schema.SchemaNode, value: list)[source]¶ Validate root versions.
-
class
POSTItemRequestSchema(*arg, **kw)[source]¶ Bases:
adhocracy_core.rest.schemas.POSTResourceRequestSchemaData structure for Item and ItemVersion POST requests.
-
class
POSTResourceRequestSchemaList(*args, **kw)[source]¶ Bases:
adhocracy_core.schema.SequenceSchemaOverview of POST request/response data structure.
-
class
GETLocationMapping(*arg, **kw)[source]¶ Bases:
adhocracy_core.schema.MappingSchemaOverview of GET request/response data structure.
-
class
PUTLocationMapping(*arg, **kw)[source]¶ Bases:
adhocracy_core.schema.MappingSchemaOverview of PUT request/response data structure.
-
class
POSTLocationMapping(*arg, **kw)[source]¶ Bases:
adhocracy_core.schema.MappingSchemaOverview of POST request/response data structure.
-
class
POSTLoginUsernameRequestSchema(*arg, **kw)[source]¶ Bases:
adhocracy_core.schema.MappingSchemaSchema for login requests via username and password.
-
create_validate_activation_path(context, request: pyramid.request.Request, registry: pyramid.registry.Registry) → <built-in function callable>[source]¶ Validate the users activation path.
If valid and activated, the user object is added as ‘user’ to request.validated.
-
class
POSTActivateAccountViewRequestSchema(*arg, **kw)[source]¶ Bases:
adhocracy_core.schema.MappingSchemaSchema for account activation.
-
create_validate_login(context, request: pyramid.request.Request, registry: pyramid.registry.Registry, child_node_name: str)[source]¶ Return validator to check the user identifier of a login request.
Parameters: child_node_name ( str) – child node to get the login (email or name)If valid, the user object is added as ‘user’ to request.validated.
-
create_validate_login_password(request: pyramid.request.Request, registry: pyramid.registry.Registry) → <built-in function callable>[source]¶ Return validator to check the password of a login request.
Requires the user object as user in request.validated.
-
create_validate_account_active(request: pyramid.request.Request, child_node_name: str) → <built-in function callable>[source]¶ Return validator to check the user account is already active.
Parameters: child_node_name ( str) – The name of the child node to raise error.Requires the user object as user in request.validated.
-
class
POSTLoginEmailRequestSchema(*arg, **kw)[source]¶ Bases:
adhocracy_core.schema.MappingSchemaSchema for login requests via email and password.
-
class
POSTReportAbuseViewRequestSchema(*arg, **kw)[source]¶ Bases:
adhocracy_core.schema.MappingSchemaSchema for abuse reports.
-
interface
MessageUserReference[source]¶ Extends:
adhocracy_core.interfaces.SheetToSheetDummy reference to validate user resources.
-
class
POSTMessageUserViewRequestSchema(*arg, **kw)[source]¶ Bases:
adhocracy_core.schema.MappingSchemaSchema for messages to a user.
-
class
BatchHTTPMethod(*arg, **kw)[source]¶ Bases:
adhocracy_core.schema.SingleLineAn HTTP method in a batch request.
-
validator= <colander.OneOf object>¶
-
missing= <object object>¶
-
-
class
BatchRequestPath(*arg, **kw)[source]¶ Bases:
adhocracy_core.schema.SingleLineA path in a batch request.
Either a resource url or a preliminary resource path (a relative path preceded by ‘@’) or an absolute path.
Example values: '@item/v1‘, ‘http://a.org/adhocracy/item/v1‘, ‘/item/v1/’
-
default= ''¶
-
missing= <object object>¶
-
absolutpath= '/[a-zA-Z0-9\\_\\-\\.\\/]+'¶
-
preliminarypath= '[a-zA-Z0-9\\_\\-\\.\\/]+'¶
-
validator= <colander.All object>¶
-
-
class
POSTBatchRequestItem(*arg, **kw)[source]¶ Bases:
adhocracy_core.schema.MappingSchemaA single item in a batch request, encoding a single request.
-
path= None¶ A single item in a batch request, encoding a single request.
-
-
class
POSTBatchRequestSchema(*args, **kw)[source]¶ Bases:
adhocracy_core.schema.SequenceSchemaSchema for batch requests (list of POSTBatchRequestItem’s).
-
class
PoolElementsForm(*arg, **kw)[source]¶ Bases:
adhocracy_core.schema.SingleLineThe form of the elements attribute returned by the pool sheet.
-
validator= <colander.OneOf object>¶
-
missing= 'paths'¶
-
-
class
PoolQueryDepth(*arg, **kw)[source]¶ Bases:
adhocracy_core.schema.IntegerThe nesting depth of descendants in a pool response.
Either a positive number or the string ‘all’ to return descendants of arbitrary depth.
-
missing= <colander._drop object>¶
-
validator= <colander.Range object>¶
-
-
class
GETPoolRequestSchema(*args, **kwargs)[source]¶ Bases:
adhocracy_core.schema.MappingSchemaGET parameters accepted for pool queries.
-
deserialize(cstruct=<colander.null>)[source]¶ Deserialize the cstruct into an appstruct.
Adapt key/values to
adhocracy_core.interfaces.SearchQuery. for BBB.TODO: Change API according to internal SearchQuery api. refactor to follow coding guideline better.
-
-
add_arbitrary_filter_nodes(cstruct: dict, schema: adhocracy_core.rest.schemas.GETPoolRequestSchema, context: <InterfaceClass adhocracy_core.interfaces.IResource>, registry) → adhocracy_core.rest.schemas.GETPoolRequestSchema[source]¶ Add schema nodes for arbitrary/references filters to schema.
-
class
KeywordComparableSchema(*arg, **kw)[source]¶ Bases:
adhocracy_core.schema.SingleLineSingleLine of KeywordComparable value.
-
validator= <colander.OneOf object>¶
-
-
class
KeywordSequenceComparableSchema(*arg, **kw)[source]¶ Bases:
adhocracy_core.schema.SingleLineSingleLine of KeywordSequenceComparable value.
-
validator= <colander.OneOf object>¶
-
-
class
KeywordComparableSequenceBase(*arg, **kw)[source]¶ Bases:
adhocracy_core.schema.TupleSchemaTuple with value KeywordSequenceComparable.
-
class
KeywordComparableIntegers(*arg, **kw)[source]¶ Bases:
adhocracy_core.rest.schemas.KeywordComparableSequenceBaseTuple with values KeywordSequenceComparable and Integers.
-
class
KeywordComparableInterfaces(*arg, **kw)[source]¶ Bases:
adhocracy_core.rest.schemas.KeywordComparableSequenceBaseTuple with values KeywordSequenceComparable and Interfaces.
-
class
KeywordComparableSingleLines(*arg, **kw)[source]¶ Bases:
adhocracy_core.rest.schemas.KeywordComparableSequenceBaseTuple with values KeywordSequenceComparable and SingleLines.
-
class
KeywordComparableDateTimes(*arg, **kw)[source]¶ Bases:
adhocracy_core.rest.schemas.KeywordComparableSequenceBaseTuple with values KeywordSequenceComparable and DateTimes.
-
class
KeywordComparableBooleans(*arg, **kw)[source]¶ Bases:
adhocracy_core.rest.schemas.KeywordComparableSequenceBaseTuple with values KeywordSequenceComparable and Booleans.
-
class
KeywordComparableBase(*arg, **kw)[source]¶ Bases:
adhocracy_core.schema.TupleSchemaTuple with value KeywordComparable.
-
class
KeywordComparableInteger(*arg, **kw)[source]¶ Bases:
adhocracy_core.rest.schemas.KeywordComparableBaseTuple with values KeywordComparable and Integer.
-
class
KeywordComparableInterface(*arg, **kw)[source]¶ Bases:
adhocracy_core.rest.schemas.KeywordComparableBaseTuple with values KeywordComparable and Interface.
-
class
KeywordComparableSingleLine(*arg, **kw)[source]¶ Bases:
adhocracy_core.rest.schemas.KeywordComparableBaseTuple with values KeywordComparable and SingleLine.
-
class
KeywordComparableBoolean(*arg, **kw)[source]¶ Bases:
adhocracy_core.rest.schemas.KeywordComparableBaseTuple with values KeywordComparable and Boolean.
-
class
KeywordComparableDateTime(*arg, **kw)[source]¶ Bases:
adhocracy_core.rest.schemas.KeywordComparableBaseTuple with values KeywordComparable and DateTime.
-
class
FieldComparableSchema(*arg, **kw)[source]¶ Bases:
adhocracy_core.schema.SingleLineSingleLine of FieldComparable value.
-
validator= <colander.OneOf object>¶
-
-
class
FieldSequenceComparableSchema(*arg, **kw)[source]¶ Bases:
adhocracy_core.schema.SingleLineSingleLine of FieldSequenceComparable value.
-
validator= <colander.OneOf object>¶
-
-
class
FieldComparableSequenceBase(*arg, **kw)[source]¶ Bases:
adhocracy_core.schema.TupleSchemaTuple with value FieldSequenceComparable.
-
class
FieldComparableIntegers(*arg, **kw)[source]¶ Bases:
adhocracy_core.rest.schemas.FieldComparableSequenceBaseTuple with values FieldSequenceComparable and Integers.
-
class
FieldComparableFloats(*arg, **kw)[source]¶ Bases:
adhocracy_core.rest.schemas.FieldComparableSequenceBaseTuple with values FieldSequenceComparable and Floats.
-
class
FieldComparableInterfaces(*arg, **kw)[source]¶ Bases:
adhocracy_core.rest.schemas.FieldComparableSequenceBaseTuple with values FieldSequenceComparable and Interfaces.
-
class
FieldComparableSingleLines(*arg, **kw)[source]¶ Bases:
adhocracy_core.rest.schemas.FieldComparableSequenceBaseTuple with values FieldSequenceComparable and SingleLines.
-
class
FieldComparableDateTimes(*arg, **kw)[source]¶ Bases:
adhocracy_core.rest.schemas.FieldComparableSequenceBaseTuple with values FieldSequenceComparable and DateTimes.
-
class
FieldComparableBooleans(*arg, **kw)[source]¶ Bases:
adhocracy_core.rest.schemas.FieldComparableSequenceBaseTuple with values FieldSequenceComparable and Booleans.
-
class
FieldComparableBase(*arg, **kw)[source]¶ Bases:
adhocracy_core.schema.TupleSchemaTuple with value FieldComparable.
-
class
FieldComparableInteger(*arg, **kw)[source]¶ Bases:
adhocracy_core.rest.schemas.FieldComparableBaseTuple with values FieldComparable and Integer.
-
class
FieldComparableFloat(*arg, **kw)[source]¶ Bases:
adhocracy_core.rest.schemas.FieldComparableBaseTuple with values FieldComparable and Float.
-
class
FieldComparableInterface(*arg, **kw)[source]¶ Bases:
adhocracy_core.rest.schemas.FieldComparableBaseTuple with values FieldComparable and Interface.
-
class
FieldComparableSingleLine(*arg, **kw)[source]¶ Bases:
adhocracy_core.rest.schemas.FieldComparableBaseTuple with values FieldComparable and SingleLine.
-
class
FieldComparableBoolean(*arg, **kw)[source]¶ Bases:
adhocracy_core.rest.schemas.FieldComparableBaseTuple with values FieldComparable and Boolean.
-
class
FieldComparableDateTime(*arg, **kw)[source]¶ Bases:
adhocracy_core.rest.schemas.FieldComparableBaseTuple with values FieldComparable and DateTime.
-
class
POSTCreatePasswordResetRequestSchema(*arg, **kw)[source]¶ Bases:
adhocracy_core.schema.MappingSchemaSchema to create a user password reset.
-
class
POSTPasswordResetRequestSchema(*arg, **kw)[source]¶ Bases:
adhocracy_core.schema.MappingSchemaSchema to get a user password reset resource.
-
class
POSTLoginServiceKontoSchema(*arg, **kw)[source]¶ Bases:
adhocracy_core.schema.MappingSchemaSchema for login requests via service konto token.