LEFT | RIGHT |
1 Flask-Tryton | 1 Flask-Tryton |
2 ============ | 2 ============ |
3 | 3 |
4 Adds Tryton support to Flask application. | 4 Adds Tryton support to Flask application. |
5 | 5 |
6 By default transactions are readonly except for PUT, POST, DELETE and PATCH | 6 By default transactions are readonly except for PUT, POST, DELETE and PATCH |
7 request methods. | 7 request methods. |
8 It provides also 2 routing converters `record` and `records`. | 8 It provides also 2 routing converters `record` and `records`. |
9 | 9 |
10 Setting the `configure_jinja` flag adds the following filters on jinja | 10 Setting the `configure_jinja` flag adds the following filters on jinja |
11 templates: `numberformat`, `dateformat`, `currencyformat` and | 11 templates: `numberformat`, `dateformat`, `currencyformat` and |
12 `timedeltaformat`. The filters apply the same formatting as Tryton reports. | 12 `timedeltaformat`. The filters apply the same formatting as Tryton reports. |
13 | 13 |
14 Nutshell | 14 Nutshell |
15 -------- | 15 -------- |
16 | 16 |
17 >>> from flask import Flask | 17 >>> from flask import Flask |
18 >>> from flask_tryton import Tryton | 18 >>> from flask_tryton import Tryton |
19 >>> app = Flask(__name__) | 19 >>> app = Flask(__name__) |
20 >>> app.config['TRYTON_DATABASE'] = 'test' | 20 >>> app.config['TRYTON_DATABASE'] = 'test' |
21 >>> tryton = Tryton(app, configure_jinja=True) | 21 >>> tryton = Tryton(app, configure_jinja=True) |
(...skipping 18 matching lines...) Expand all Loading... |
40 | 40 |
41 There are three configuration options available: | 41 There are three configuration options available: |
42 | 42 |
43 * `TRYTON_DATABASE`: the Tryton's database to connect. | 43 * `TRYTON_DATABASE`: the Tryton's database to connect. |
44 * `TRYTON_USER`: the Tryton user id to use, by default `0` (aka `root`). | 44 * `TRYTON_USER`: the Tryton user id to use, by default `0` (aka `root`). |
45 * `TRYTON_CONFIG`: the optional path to the Tryton's configuration. | 45 * `TRYTON_CONFIG`: the optional path to the Tryton's configuration. |
46 | 46 |
47 To report issues please visit the `flask_tryton bugtracker`_. | 47 To report issues please visit the `flask_tryton bugtracker`_. |
48 | 48 |
49 .. _flask_tryton bugtracker: http://flask-tryton.b2ck.com/ | 49 .. _flask_tryton bugtracker: http://flask-tryton.b2ck.com/ |
LEFT | RIGHT |