Adds Tryton support to Flask application
Project description
Adds Tryton support to Flask application.
By default transactions are readonly except for PUT, POST, DELETE and PATCH request methods.
Nutshell
>>> from flask import Flask >>> from flask_tryton import Tryton >>> app = Flask(__name__) >>> app.config['TRYTON_DATABASE'] = 'test' >>> tryton = Tryton(app) >>> User = tryton.pool.get('res.user') >>> @tryton.default_context ... def default_context(): ... return User.get_preferences(context_only=True) >>> @app.route('/') ... @tryton.transaction() ... def hello(): ... user, = User.search([('login', '=', 'admin')]) ... return '%s, Hello World!' % user.name >>> app.run()
For more information please visit the flask_tryton website.
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
flask_tryton-0.1.tar.gz
(16.1 kB
view hashes)