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

Hello, I need a simple Form View with a button which calls a function in models.py: for example I need a View like in "Update Modules List" (in Settings).

I already created a model without fields and used it in form view so I could access to the functions inside it, but I still have the buttons like "Save" at top of the view which makes me create empty records in a table (only timestamps) if pressed.

Is there a way to remove "Save" button or there's a better solution for my problem?

Any help is appreciated.


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

Hi,

Use wizard with Transient Model (to avoid save and create button)

For Eg:

class class_name(models.TransientModel):  

Or:

you can restrict create, delete and write access for that model after creating one record (give only read access)..

==> use the most convenient method for you according to your need....


Hope this helps........ 


Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 3 15
4915
0
thg 3 15
3243
3
thg 5 23
17124
1
thg 8 22
7762
3
thg 12 23
19919