diff --git a/web/CXM_web_arg_utils.anubis b/web/CXM_web_arg_utils.anubis index c082d90..fdea8ee 100644 --- a/web/CXM_web_arg_utils.anubis +++ b/web/CXM_web_arg_utils.anubis @@ -7,7 +7,21 @@ */ read tools/basis.anubis read calexium_lib/web/CXM_common.anubis +read calexium_lib/database/db_types.anubis +public define DB_id + get_DB_id + ( + List(Web_arg) lwa, + String arg_name + ) = + if web_arg_value(lwa, arg_name) is + { + not_found then none, + found(value) then + if value="none" then none else db_id(force_to_Int(value)) + }. + public define Maybe(String) get_String ( @@ -45,6 +59,18 @@ public define Bool found(_) then true }. +public define Maybe(Bool) + get_Bool + ( + List(Web_arg) lwa, + String arg_name + ) = + if web_arg_value(lwa, arg_name) is + { + not_found then success(false), + found(_) then success(true) + }. + public define Maybe(Int) get_Int ( -- libgit2 0.21.4