annotation view mapper for pyramid
Project description
rebecca.annotationmapper is viewmapper for pyramid web application. That processes annotations of view arguments.
INSTALL
$ pip install rebecca.annotationmapper
USAGE
rebecca.annotationmapper provides include fook.
config.include('rebecca.annotationmapper')
Annotate arguments using rebecca.annotationmapper.annotations
def hello(context, request, nane: FromMatchDict): request.response.text = "Hello, {name}".format(name=name) return request.response config.add_route("hello", "/hello/{name}") config.add_view(hello, route_name="hello")
The argument name annotated by FromMatchDict is given value from request.matchdict['name'] by rebecca.annotationmapper.AnnotationViewMapper.
For example, you access ‘http://localhost/hello/aodag’ and you get message ‘Hello, aodag’.
Annotations
FromMatchDict
provides value from request.matchdict.
FromParam
provides value from request.params.
FromSession
provides value from request.session.
FromHeader
provides value from request.headers.
FromAttr
provides value from attribute of request.
CHANGES
0.1
first release
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file rebecca.annotationmapper-0.1.zip
.
File metadata
- Download URL: rebecca.annotationmapper-0.1.zip
- Upload date:
- Size: 7.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d705833ea4dd221776a5ae7f726d9e4931aeacb6548af03c8e3084ee89281e5c |
|
MD5 | fdf91777c9661dae1ccc283cdb57b477 |
|
BLAKE2b-256 | 92a4944dadecb1891e6fbdfc1b6ebec128088a883ef4ccc364fab230351db537 |
File details
Details for the file rebecca.annotationmapper-0.1-py3-none-any.whl
.
File metadata
- Download URL: rebecca.annotationmapper-0.1-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 036ba4f60acd479135e5822d05881d085ee117d140ad5e25bad8dd7da90c70b9 |
|
MD5 | d50cb1271e9b9be7434ef5958473aec1 |
|
BLAKE2b-256 | 1e6eebb212970019a42a28a68e3013a78fd6cf589e06ebdbddcd8f73334d68e1 |