I've just released v0.5.1 of pyramid_route_7. it is compatible with 3.6-3.13
pyramid_route_7 offers a microtemplating language for creating more
maintainable routes in pyramid:
For example, kv patterns can be created, such as these for matching date
components:
config.include("pyramid_route_7")
config.add_route_7_kvpattern("year", r"\d\d\d\d")
config.add_route_7_kvpattern("month", r"\d\d")
config.add_route_7_kvpattern("day", r"\d\d")
Which can then be reused across multiple routes with a readable syntax:
config.add_route_7("calendar", "/calendar/{@year}/{@month}/{@day}")
This is equivalent to invoking:
config.add_route("calendar",
r"/calendar/{year:\d\d\d\d}/{month:\d\d}/{day:\d\d}")
A jsonify parameter will also create a secondary json route:
config.add_route_7("calendar", "/calendar/{@year}/{@month}/{@day}",
jsonify=True)
Which is equivalent to invoking:
config.add_route("calendar",
r"/calendar/{year:\d\d\d\d}/{month:\d\d}/{day:\d\d}")
config.add_route("calendar|json",
r"/calendar/{year:\d\d\d\d}/{month:\d\d}/{day:\d\d}.json")
Links:
Github
https://github.com/jvanasco/pyramid_route_7
PyPi
https://pypi.org/project/pyramid-route-7/
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/pylons-discuss/f9e97469-a51f-4a0d-976d-da1a5ca105d8n%40googlegroups.com.