A pyramid routes composer for javascript.
Project description
Pyramid JSRoutes
================
A pyramid routes composer for javascript.
Installation
------------
pip install -U pyramid-jsroutes
Usage
-----
Include the package in your Pyramid app's main function:
```python
def main():
...
config.include('jsroutes')
...
return config.make_wsgi_app()
```
this will make `jsroutes` available to all your template context, then you can use it like:
<script type="text/javascript">${jsroutes|n}</script>
then you can start composing your Pyramid routes from javascript like:
```javascript
JSROUTES.blog_post(1) // /posts/1
```
Settings
--------
By default it'll only collect the routes once and store it in the registry but you can force reloading everytime for development by settings the following settings:
jsroutes.reload_routes = true
Note
----
Each time your modify your Pyramid routes, you need to refresh your page to refetch the updated routes.
.. :changelog:
History
-------
0.1.2 (2013-07-07)
+++++++++++++++++++
- Removed rendering of build route args when route doesn't have args
0.1.1 (2013-07-06)
+++++++++++++++++++
- Added `jsroutes.reload_routes` settings
0.1.0 (2013-07-06)
+++++++++++++++++++
- Initial commit
================
A pyramid routes composer for javascript.
Installation
------------
pip install -U pyramid-jsroutes
Usage
-----
Include the package in your Pyramid app's main function:
```python
def main():
...
config.include('jsroutes')
...
return config.make_wsgi_app()
```
this will make `jsroutes` available to all your template context, then you can use it like:
<script type="text/javascript">${jsroutes|n}</script>
then you can start composing your Pyramid routes from javascript like:
```javascript
JSROUTES.blog_post(1) // /posts/1
```
Settings
--------
By default it'll only collect the routes once and store it in the registry but you can force reloading everytime for development by settings the following settings:
jsroutes.reload_routes = true
Note
----
Each time your modify your Pyramid routes, you need to refresh your page to refetch the updated routes.
.. :changelog:
History
-------
0.1.2 (2013-07-07)
+++++++++++++++++++
- Removed rendering of build route args when route doesn't have args
0.1.1 (2013-07-06)
+++++++++++++++++++
- Added `jsroutes.reload_routes` settings
0.1.0 (2013-07-06)
+++++++++++++++++++
- Initial commit
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
File details
Details for the file pyramid-jsroutes-0.1.2.tar.gz
.
File metadata
- Download URL: pyramid-jsroutes-0.1.2.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99a8ffcbfda41a7be7adcd59b89ebac355ac0c23108e3fe36bf015dee9cfad93 |
|
MD5 | e8bd8bf420dd3098a7e4ce47b2d9c23a |
|
BLAKE2b-256 | 8fefbdee2d5ce5e6fed049ba60d87598c2981e497361b8bcf82c5c4d81c69f14 |