diff --git a/types/model/fields.anubis b/types/model/fields.anubis index facf655..5d66395 100644 --- a/types/model/fields.anubis +++ b/types/model/fields.anubis @@ -76,6 +76,17 @@ public type HK_Text_Choice: public type HK_Text_Choices: no_choice, text_choices(List(HK_Text_Choice)). + +public type HK_Int_Choice: + hk_int_choice( + Int value, //value to set in database corresponding to description below + String visible //visible string which help the user to choose teh correct choice + ). + +public type HK_Int_Choices: + no_choice, //No list choice is available. Hence the user must enter the value + int_choices(List(HK_Int_Choice)). //List of possible choices + public type HK_Datetime_Field_Attr: none, //Nothing special, normal behaviour @@ -121,9 +132,10 @@ public type HK_Model_Field: date_field (HK_Datetime_Field_Attr), // date with the precision of the day time_field (HK_Datetime_Field_Attr), // time with the precision of the second 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 (HK_Text_Choices choices, Int size), // text of maximal size 'size' (number of characters) + 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 (HK_Int_Choices choices), // integer of arbitrary size + char_field (HK_Text_Choices choices, Int size), // text of maximal size 'size' (number of characters) + //password_field(Int min_size), text_field. // text of variable size //default initialization @@ -133,6 +145,11 @@ public define HK_Model_Field Int size )= char_field(no_choice, size). + +public define HK_Model_Field + integer_field + = + integer_field(no_choice). public define HK_Model_Field foreign_key @@ -199,7 +216,8 @@ public define Message forget(add_message(hk_model_field_message, "app_name", to_Message(app_name))); forget(add_string(hk_model_field_message, "table_name", table_name)), - integer_field then // integer of arbitrary size + integer_field(choices) then // integer of arbitrary size + //TODO add choices if need forget(add_string(hk_model_field_message, "type", "integer_field")), char_field (choices, size) then // text of maximal size 'size' (number of characters) -- libgit2 0.21.4