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

When clicking the Save button on a form, I understood the Create method is executed. So all models on the form are automatically linked together (according to foreign keys) and saved in the database ?

I'm trying, by overriding Create method, to modify some behaviours and I need to get new records from the form inside the method. However, I suppose there is no ID until the end of the transaction which appends at the end of the method.

Maybe I'm totally wrong, all this is new for me.


EDIT: Looks like the "vals" parameter of Create method contains the values of all fields, so if I change values of vals, records will be saved with my new values I suppose.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 3 20
4918
1
thg 1 19
3596
4
thg 6 17
19933
2
thg 1 23
20972
1
thg 1 20
7098