Web to py enterprise web framework - p 24

CRUD 215 1 def data: return dict(form=crud()) would expose the following URLs: 1 2 3 4 5 http://./[app]/[controller]/data/tables http://./[app]/[controller]/data/create/[tablename] http://./[app]/[controller]/data/read/[tablename]/[id] http://./[app]/[controller]/data/delete/[tablename] http://./[app]/[controller]/data/select/[tablename] However, the following action: 1 2 def create_tablename: return dict(form=()) would only expose the create method 1 http://./[app]/[controller]/create_tablename While the following action: 1 2 def update_tablename: return dict(form=(, (0))) would only expose the update method 1 http://./[app]/[controller]/update_tablename and so on. The behavior of CRUD can be customized in two ways: by setting some attributes of the crud object or by passing extra parameters to each of its methods. Attributes Here is a complete list of current CRUD attributes, their default values,. | CRUD 215 1 1 2 3 4 5 1 2 1 1 2 1 1 1 1 1 1 def data return dict form crud would expose the following URLs http . app controller data tables http . app controller data create tablename http . app controller data read tablename id http . app controller data delete tablename http . app controller data select tablename However the following action def create_tablename return dict form would only expose the create method http . app controller create_tablename While the following action def update_tablename return dict form 0 would only expose the update method http . app controller update_tablename and so on. The behavior of CRUD can be customized in two ways by setting some attributes of the crud object or by passing extra parameters to each of its methods. Attributes Here is a complete list of current CRUD attributes their default values and meaning specifies the URL to redirect to after a successful create record. specifies the URL to redirect to after a successful update record. specifies the URL to redirect to after a successful delete record. URL r request f download specifies the URL to be used for linking uploaded files. lambda form None 216 FORMS AND VALIDATORS is an optional function to be called onvalidation of create forms see SQL-FORM onvalidation 1 lambda form None is an optional function to be called onvalidation of update forms see SQLFORM onvalidation 1 lambda form None is an optional function to be called before redirect after successful create record. This function takes the form as its only argument. 1 lambda form None is an optional function to be called before redirect after successful update record. This function takes .

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
2    136    2    26-06-2024
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.