The project intend to or extendig the capabilities of flask in order to read and write data directely to tryton.
Project description
** FlaskTrytonWTF This project is intend to be used for extendig the capabilities of flask in order to read and write data directely to tryton
issiue/info: info@omniasolutions.eu
You can use this extention like a normal FlaskForm Just remember to add trytonObject and the field that you like to see in your input form we also inser the subbit button in and if its pressed we write date into tryton
from FlaskTrytonWTF import FTWTF
...
...
...
class MyTrytonForm(FTWTF.TFlaskForm):
trytonObject = tryton.pool.get('my.tryton.object')
tryton_fields = {'field_1': {},
'field_2': {},
'field_3': {}
}
submitLable = "Submit"
@app.route('/input_form', methods=['GET', 'POST'])
@tryton.transaction()
def input_form():
form = MyTrytonForm()
if form.validate_on_submit():
data_submitted = form.trytonSubmit() # DO NOT FORGET TO CALL THE TRYTON SUBMIT IN ORDER DO FLUSH THE DATA
# ALSO THE DATA SUBMITTED IS RETURNED AS DICTIONAY OF VALUES
# SO YOU CAN USE IF !!
return render_template('show_input_confirmation.html', title='Conferma', form=data_submitted)
return render_template('input_form.html', form=form)
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
FlaskTrytonWTF-0.0.2.tar.gz
(4.2 kB
view hashes)
Built Distribution
Close
Hashes for FlaskTrytonWTF-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c798badafa3542003dc39ab72ed5aa345e049a4420cd3c599636e9617fe86df6 |
|
MD5 | b19ab6e5962302e65c85fb6e3848313c |
|
BLAKE2b-256 | 44a7b26c68eb7e0b347b465e275ecd3299a2a3d00847994a0c991b809a36aeab |