Commit ce99911c61350a97be362020fd55e1bcaa2945aa
1 parent
b4174bba
[+] introduce helper for getting row show string directly from vtm, table_name and id
Showing
1 changed file
with
16 additions
and
1 deletions
Show diff stats
controller/hk_utils.anubis
| ... | ... | @@ -23,7 +23,7 @@ public define Maybe(Int) |
| 23 | 23 | |
| 24 | 24 | if get_hk_controller(_vtm.hk_controllers, table_name) is |
| 25 | 25 | { |
| 26 | - failure then println("can't get writer for "+table_name);failure, | |
| 26 | + failure then println("update_row can't get hk_controller for "+table_name);failure, | |
| 27 | 27 | success(controller) then |
| 28 | 28 | //forget(map((HK_Trigger trigger) |-> println("call trigger before update "+trigger.trigger_name+" ON table "+table_name); trigger.trigger_call_back(db, _session), *controller.triggers.before_update)); |
| 29 | 29 | |
| ... | ... | @@ -37,3 +37,18 @@ public define Maybe(Int) |
| 37 | 37 | } |
| 38 | 38 | } |
| 39 | 39 | . |
| 40 | + | |
| 41 | +public define String | |
| 42 | + row_show_string | |
| 43 | + ( | |
| 44 | + SQLite3DataBase db, | |
| 45 | + VTM _vtm, | |
| 46 | + String table_name, | |
| 47 | + DB_id id | |
| 48 | + )= | |
| 49 | + if get_hk_controller(_vtm.hk_controllers, table_name) is | |
| 50 | + { | |
| 51 | + failure then println("show_string can't get hk_controller for "+table_name);"ERROR: can't get hk_controller for "+table_name, | |
| 52 | + success(controller) then controller.get_show_string(db, id) | |
| 53 | + } | |
| 54 | +. | ... | ... |