Skip to main content

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


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 details)

Uploaded Source

File details

Details for the file flask_tryton-0.1.tar.gz.

File metadata

  • Download URL: flask_tryton-0.1.tar.gz
  • Upload date:
  • Size: 16.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for flask_tryton-0.1.tar.gz
Algorithm Hash digest
SHA256 2120d9d3b35757adb7bca77902fafb6444e1ae4a6602dc5e3d06bcdabe09f3f3
MD5 04b3d0916a943b536566683c40a10cda
BLAKE2b-256 daab2a6f4ebc57e18ca117a92bf76b268dd7971dcf5679d6f548e6e7d7f1b0a3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page