Commit c6605b532d8610d3bbbad66926aa149aa86e8f88

Authored by totoro
1 parent f3cb0a1f

update integer field

Showing 1 changed file with 22 additions and 4 deletions   Show diff stats
types/model/fields.anubis
@@ -76,6 +76,17 @@ public type HK_Text_Choice: @@ -76,6 +76,17 @@ public type HK_Text_Choice:
76 public type HK_Text_Choices: 76 public type HK_Text_Choices:
77 no_choice, 77 no_choice,
78 text_choices(List(HK_Text_Choice)). 78 text_choices(List(HK_Text_Choice)).
  79 +
  80 +public type HK_Int_Choice:
  81 + hk_int_choice(
  82 + Int value, //value to set in database corresponding to description below
  83 + String visible //visible string which help the user to choose teh correct choice
  84 + ).
  85 +
  86 +public type HK_Int_Choices:
  87 + no_choice, //No list choice is available. Hence the user must enter the value
  88 + int_choices(List(HK_Int_Choice)). //List of possible choices
  89 +
79 90
80 public type HK_Datetime_Field_Attr: 91 public type HK_Datetime_Field_Attr:
81 none, //Nothing special, normal behaviour 92 none, //Nothing special, normal behaviour
@@ -121,9 +132,10 @@ public type HK_Model_Field: @@ -121,9 +132,10 @@ public type HK_Model_Field:
121 date_field (HK_Datetime_Field_Attr), // date with the precision of the day 132 date_field (HK_Datetime_Field_Attr), // date with the precision of the day
122 time_field (HK_Datetime_Field_Attr), // time with the precision of the second 133 time_field (HK_Datetime_Field_Attr), // time with the precision of the second
123 datetime_field(HK_Datetime_Field_Attr), // datetime with the precision of the second 134 datetime_field(HK_Datetime_Field_Attr), // datetime with the precision of the second
124 - 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.  
125 - integer_field, // integer of arbitrary size  
126 - char_field (HK_Text_Choices choices, Int size), // text of maximal size 'size' (number of characters) 135 + 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.
  136 + integer_field (HK_Int_Choices choices), // integer of arbitrary size
  137 + char_field (HK_Text_Choices choices, Int size), // text of maximal size 'size' (number of characters)
  138 + //password_field(Int min_size),
127 text_field. // text of variable size 139 text_field. // text of variable size
128 140
129 //default initialization 141 //default initialization
@@ -133,6 +145,11 @@ public define HK_Model_Field @@ -133,6 +145,11 @@ public define HK_Model_Field
133 Int size 145 Int size
134 )= 146 )=
135 char_field(no_choice, size). 147 char_field(no_choice, size).
  148 +
  149 +public define HK_Model_Field
  150 + integer_field
  151 + =
  152 + integer_field(no_choice).
136 153
137 public define HK_Model_Field 154 public define HK_Model_Field
138 foreign_key 155 foreign_key
@@ -199,7 +216,8 @@ public define Message @@ -199,7 +216,8 @@ public define Message
199 forget(add_message(hk_model_field_message, "app_name", to_Message(app_name))); 216 forget(add_message(hk_model_field_message, "app_name", to_Message(app_name)));
200 forget(add_string(hk_model_field_message, "table_name", table_name)), 217 forget(add_string(hk_model_field_message, "table_name", table_name)),
201 218
202 - integer_field then // integer of arbitrary size 219 + integer_field(choices) then // integer of arbitrary size
  220 + //TODO add choices if need
203 forget(add_string(hk_model_field_message, "type", "integer_field")), 221 forget(add_string(hk_model_field_message, "type", "integer_field")),
204 222
205 char_field (choices, size) then // text of maximal size 'size' (number of characters) 223 char_field (choices, size) then // text of maximal size 'size' (number of characters)