Adding @config Args¶
Fields¶
-
Application.
add_config_field
(content_type, name, *args, **kwargs)[source]¶ Add a config field that can be passed via
@config
.This allows extensions to add additional keyword args for
@config
. These args will be accessible as attributes of theresource.config.Config
object returned byrequest.resource_config
.These fields can serve any purpose. For example, a
permission
field could be added, which would be accessible asrequest.resource_config.permission
. This could be checked in an auth handler to verify the user has the specified permission.See
_add_config_arg()
for more detail.
Representation Args¶
-
Application.
add_representation_arg
(*args, **kwargs)[source]¶ Add a representation arg that can be specified via @config.
This allows extensions to add additional keyword args for
@config
. These args will be passed as keyword args to the representation type that is used for the request.These args are accessible via the
representation_args
dict of theresource.config.Config
object returned byrequest.resource_config
(but generally would not be accessed directly).See
_add_config_arg()
for more detail.