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

I want to add a custom field that is stored in the database so that each message has its own state (true or false), this is my js code:


i don't know if i need a py file or something else, any help would be appreciated.



edit:

my goal is to make it so each time the action button that is connected to the _onClickDone method is clicked the color of the message background is changed based on the isDone field, the problem is that the changes right now are temporary,and whenever i refresh the page it reverts back to the original state.

and wcould you please give me an example on what you mean by using py file?

Ảnh đại diện
Huỷ bỏ

I usually add fields using py file. 
I dont know what you are trying to do here. 
Please explain more about what you are trying to achieve.

Create a field in 'mail.message' model and When you click on _onClickDone the field should save that the message was clicked and then add your color on the basis of that field in javascript.