above code from the website_mail module in controller email_designer.py file
from openerp.addons.web import http from openerp.addons.web.http import request
class WebsiteEmailDesigner(http.Controller):
@http.route('/website_mail/email_designer/<model("email.template"):template>/', type='http', auth="user", website=True, multilang=True)
def index(self, template, **kw):
values = {
'template': template,
}
print 'TEMPLATE DETAIL >>>>>>>>>>>',template
return request.website.render("website_mail.designer_index", values)
@http.route(['/website_mail/snippets'], type='json', auth="user", website=True)
def snippets(self):
return request.website._render('website_mail.email_designer_snippets')
my question is can any one explain me why @http.route() method use type="json" and type="http" attribute which situation we are using type="json" in controller and type="http" in controller and why it is require to do . . ??