Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(266)

Delta Between Two Patch Sets: README

Issue 45370043: flask_tryton (Closed)
Left Patch Set: Created 11 years, 3 months ago
Right Patch Set: Don't start a transaction for context if not needed Created 11 years, 3 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « MANIFEST.in ('k') | flask_tryton.py » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
1 Flask-Tryton
2 ============
3
4 Adds Tryton support to Flask application.
5
6 By default transactions are readonly except for PUT, POST, DELETE and PATCH
7 request methods.
8
9 Nutshell
10 --------
11
12 >>> from flask import Flask
13 >>> from flask_tryton import Tryton
14
15 >>> app = Flask(__name__)
16 >>> app.config['TRYTON_DATABASE'] = 'test'
17 >>> tryton = Tryton(app)
18 >>> User = tryton.pool.get('res.user')
19
20 >>> @tryton.default_context
21 ... def default_context():
22 ... return User.get_preferences(context_only=True)
23
24 >>> @app.route('/')
25 ... @tryton.transaction()
26 ... def hello():
27 ... user, = User.search([('login', '=', 'admin')])
28 ... return '%s, Hello World!' % user.name
29
30 >>> app.run()
31
32 For more information please visit the `flask_tryton website`_.
33
34 .. _flask_tryton website: http://code.google.com/p/flask-tryton/
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b