Commit 57345f2acee9ffeb19673b957d0aeb7296dfb742
1 parent
0e255eaa
some cleanup
Showing
1 changed file
with
0 additions
and
42 deletions
Show diff stats
model/fields.anubis
| @@ -261,45 +261,3 @@ public define JsonValue | @@ -261,45 +261,3 @@ public define JsonValue | ||
| 261 | }, | 261 | }, |
| 262 | 262 | ||
| 263 | json_object("_HK_FIELD", members). | 263 | json_object("_HK_FIELD", members). |
| 264 | - | ||
| 265 | - define Maybe(HK_Model_Field) | ||
| 266 | - get_field | ||
| 267 | - ( | ||
| 268 | - Message hk_model_field_message, | ||
| 269 | - String type | ||
| 270 | - )= | ||
| 271 | - if type = "p_key" then success(p_key) | ||
| 272 | - else if type = "boolean_field" then success(boolean_field) | ||
| 273 | - else if type = "date_field" then success(date_field(get_dt_attribute(hk_model_field_message))) | ||
| 274 | - else if type = "time_field" then success(time_field(get_dt_attribute(hk_model_field_message))) | ||
| 275 | - else if type = "datetime_field" then success(datetime_field(get_dt_attribute(hk_model_field_message))) | ||
| 276 | - else if type = "foreign_key" then | ||
| 277 | - if find_string(hk_model_field_message, "table_name") is {failure then failure, success(table_name) then | ||
| 278 | - if find_message(hk_model_field_message, "app_name") is {failure then failure, success(msg_app_name) then | ||
| 279 | - if from_Message(msg_app_name) is {failure then failure, success(app_name) then | ||
| 280 | - success(foreign_key(app_name, table_name)) | ||
| 281 | - }}} | ||
| 282 | - else if type = "integer_field" then success(integer_field) | ||
| 283 | - else if type = "float_field" then success(float_field) | ||
| 284 | - else if type = "char_field" then | ||
| 285 | - if find_int32(hk_model_field_message, "size") is {failure then failure, success(w32_size) then | ||
| 286 | - success(char_field(to_Int(w32_size)))} | ||
| 287 | - else if type = "password_field" then | ||
| 288 | - if find_int32(hk_model_field_message, "size") is {failure then failure, success(w32_size) then | ||
| 289 | - success(password_field(to_Int(w32_size)))} | ||
| 290 | - else if type = "text_field" then success(text_field(get_text_attribute(hk_model_field_message))) | ||
| 291 | - else failure | ||
| 292 | - . | ||
| 293 | - | ||
| 294 | - public define Maybe(HK_Model_Field) | ||
| 295 | - from_Message | ||
| 296 | - ( | ||
| 297 | - Message hk_model_field_message | ||
| 298 | - )= | ||
| 299 | - if *hk_model_field_message.what = _HK_FIELD then | ||
| 300 | - if find_string(hk_model_field_message, "type") is {failure then failure, success(type) then | ||
| 301 | - get_field(hk_model_field_message, type) | ||
| 302 | - } | ||
| 303 | - else | ||
| 304 | - failure | ||
| 305 | - . |