diff --git a/types/model/fields.anubis b/types/model/fields.anubis index e995c77..facf655 100644 --- a/types/model/fields.anubis +++ b/types/model/fields.anubis @@ -70,7 +70,13 @@ public define Maybe(HK_App_Name) failure . - +public type HK_Text_Choice: + hk_text_choice(String value, String visible). + +public type HK_Text_Choices: + no_choice, + text_choices(List(HK_Text_Choice)). + public type HK_Datetime_Field_Attr: none, //Nothing special, normal behaviour auto_now, //Always update datetime at SQL update @@ -117,9 +123,17 @@ public type HK_Model_Field: datetime_field(HK_Datetime_Field_Attr), // datetime with the precision of the second foreign_key (HK_App_Name app_name, String table_name), // foreign key to 'id' in another (or same) table and column_name for choice selector. integer_field, // integer of arbitrary size - char_field (Int size), // text of maximal size 'size' (number of characters) + char_field (HK_Text_Choices choices, Int size), // text of maximal size 'size' (number of characters) text_field. // text of variable size +//default initialization +public define HK_Model_Field + char_field + ( + Int size + )= + char_field(no_choice, size). + public define HK_Model_Field foreign_key ( @@ -188,7 +202,8 @@ public define Message integer_field then // integer of arbitrary size forget(add_string(hk_model_field_message, "type", "integer_field")), - char_field (size) then // text of maximal size 'size' (number of characters) + char_field (choices, size) then // text of maximal size 'size' (number of characters) + //TODO add choices if need forget(add_string(hk_model_field_message, "type", "char_field")); forget(add_int32(hk_model_field_message, "size", truncate_to_Word32(size))), -- libgit2 0.21.4