Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
2519 Lượt xem

Hi everyone,

I´ve created a custom website form where collect data from people. These people could be already contact so one field of the form is contact_related. I can get contact and show it in a datalist but I can´t save it the controller to create a new record.

Note: I´m able to record all the others fields but not contact related


 
@http.route('/crear/registro', type="http", auth='public', website=True)
def create_registry(self, **kw):
image = kw.get('attachment', False)
kw.update({
'attachment': base64.encodestring(image.read()) if image else False

})
request.env['feria.registro'].sudo().create(kw)

return request.render("feria.registry_thanks", {})

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

You have to create a form in your view and then connect the form to the controller method to pass the values to be saved in database.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 2 24
5082
1
thg 6 23
5331
2
thg 5 22
14966
2
thg 7 24
4054
2
thg 5 25
9681