Tuesday, 19 March 2019

Send values to web page - Web Controllers, Active elements

Send values to web page - Web Controllers


We need to transmit on rendering page some vars, you need to put that vars in dictionary and place it as second argument:
@http.route(['/shop/checkout'], type='http', auth="public", website=True)
def checkout(self, **post):
...
values['order'] = order
return request.website.render("website_sale.checkout", values) 


Active elements

Submit with button

<form action="/my_page" name="myform" method="post">
        <button type="submit" class="btn btn-default">My button</button>
</form>

Wherein in controller in **post will be available some values from source form, those like <input/>.









No comments:

Post a Comment