Commit 1fd8afcbd896495c05e0256570f4472ccb980998

Authored by David RENÉ
1 parent b28ba961

add active_filters in HK_foreign_key

ds_files/graphviz.gv
1 1 /*
2 2 * Created by 伝作 (Densaku).
3 3 * Types & Messages generator written by フランスのトトロ aka (David RENÉ)
4   - * Date: 2018-11-10
5   - * Time: 17:14:38
  4 + * Date: 2019-07-14
  5 + * Time: 16:15:41
6 6 *
7 7 */
8 8  
... ... @@ -159,6 +159,7 @@ digraph DS {
159 159 <TR><TD ALIGN="LEFT"><B><FONT COLOR="mediumblue">HK_App_Name</FONT></B></TD><TD ALIGN="LEFT" PORT="foreign_key_app_name" >app_name</TD></TR>
160 160 <TR><TD ALIGN="LEFT"><B><FONT COLOR="darkviolet">String</FONT></B></TD><TD ALIGN="LEFT" PORT="foreign_key_table_name" >table_name</TD></TR>
161 161 <TR><TD ALIGN="LEFT"><B><FONT COLOR="darkviolet">List</FONT>(<FONT COLOR="darkviolet">String</FONT>)</B></TD><TD ALIGN="LEFT" PORT="foreign_key_searchable_fields" >searchable_fields</TD></TR>
  162 + <TR><TD ALIGN="LEFT"><B><FONT COLOR="darkviolet">List</FONT>(<FONT COLOR="mediumblue">HK_Foreign_Key_Active_Filter</FONT>)</B></TD><TD ALIGN="LEFT" PORT="foreign_key_hk_fk_active_filter" >hk_fk_active_filter</TD></TR>
162 163 <TR><TD ALIGN="LEFT"><B><FONT COLOR="darkviolet">List</FONT>(<FONT COLOR="mediumblue">HK_Foreign_Key_Clause</FONT>)</B></TD><TD ALIGN="LEFT" PORT="foreign_key_hk_fk_clause" >hk_fk_clause</TD></TR>
163 164 <TR><TD COLSPAN="2" VALIGN="MIDDLE" ALIGN="LEFT"><FONT COLOR="orangered"><B>)</B></FONT></TD></TR>
164 165  
... ... @@ -199,6 +200,7 @@ digraph DS {
199 200 HK_Model_Field:char_field_choices -> HK_Text_Choices:TYPE
200 201 HK_Model_Field:integer_field_choices -> HK_Int_Choices:TYPE
201 202 HK_Model_Field:foreign_key_app_name -> HK_App_Name:TYPE
  203 + HK_Model_Field:foreign_key_hk_fk_active_filter -> HK_Foreign_Key_Active_Filter:TYPE
202 204 HK_Model_Field:foreign_key_hk_fk_clause -> HK_Foreign_Key_Clause:TYPE
203 205 HK_Model_Field:datetime_field_hk_dt_f_attr -> HK_Datetime_Field_Attr:TYPE
204 206 HK_Model_Field:time_field_hk_dt_f_attr -> HK_Datetime_Field_Attr:TYPE
... ... @@ -256,6 +258,20 @@ digraph DS {
256 258 HK_Foreign_Key_Clause:on_delete_on_delete -> HK_Foreign_Key_Clause_On_Directive:TYPE
257 259  
258 260  
  261 + HK_Foreign_Key_Active_Filter [ label=<
  262 + <TABLE BORDER="1" CELLBORDER="0" CELLSPACING="0" CELLPADDING="2" BGCOLOR="gray95">
  263 + <TR><TD COLSPAN="2" PORT="TYPE" VALIGN="MIDDLE" ALIGN="CENTER" BGCOLOR="lightblue" ><FONT COLOR="mediumblue"><B>HK_Foreign_Key_Active_Filter</B></FONT></TD></TR>
  264 +
  265 + <TR><TD COLSPAN="2" PORT="alt:active_filter" VALIGN="MIDDLE" BGCOLOR="bisque" ALIGN="LEFT"><FONT COLOR="orangered"><B>active_filter (</B></FONT></TD></TR>
  266 + <TR><TD ALIGN="LEFT"><B><FONT COLOR="darkviolet">String</FONT></B></TD><TD ALIGN="LEFT" PORT="active_filter_column" >column</TD></TR>
  267 + <TR><TD ALIGN="LEFT"><B><FONT COLOR="darkviolet">String</FONT></B></TD><TD ALIGN="LEFT" PORT="active_filter_fk_column" >fk_column</TD></TR>
  268 + <TR><TD COLSPAN="2" VALIGN="MIDDLE" ALIGN="LEFT"><FONT COLOR="orangered"><B>)</B></FONT></TD></TR>
  269 +
  270 + </TABLE>
  271 + >];
  272 +
  273 +
  274 +
259 275 HK_Int_Choices [ label=<
260 276 <TABLE BORDER="1" CELLBORDER="0" CELLSPACING="0" CELLPADDING="2" BGCOLOR="gray95">
261 277 <TR><TD COLSPAN="2" PORT="TYPE" VALIGN="MIDDLE" ALIGN="CENTER" BGCOLOR="lightblue" ><FONT COLOR="mediumblue"><B>HK_Int_Choices</B></FONT></TD></TR>
... ...
hayamiki_ds_types.aproj
... ... @@ -26,6 +26,9 @@
26 26 <Compile Include="hayamiki_ds_types.anubis" />
27 27 <Compile Include="hayamiki_lib\controller\hk_controller.anubis" />
28 28 <Compile Include="hayamiki_lib\controller\hk_delete.anubis" />
  29 + <Compile Include="hayamiki_lib\controller\hk_rows_import.anubis" />
  30 + <Compile Include="hayamiki_lib\controller\hk_sql_utils.anubis" />
  31 + <Compile Include="hayamiki_lib\controller\hk_trigger.anubis" />
29 32 <Compile Include="hayamiki_lib\ds_files\ds_types.anubis" />
30 33 <Compile Include="hayamiki_lib\hk_generator.anubis" />
31 34 <Compile Include="hayamiki_lib\model\app.anubis" />
... ... @@ -39,29 +42,47 @@
39 42 <Compile Include="hayamiki_lib\model\tables.anubis" />
40 43 <Compile Include="hayamiki_lib\model\types\hk_app.anubis" />
41 44 <Compile Include="hayamiki_lib\model\types\hk_app_name.anubis" />
  45 + <Compile Include="hayamiki_lib\model\types\hk_constraint.anubis" />
42 46 <Compile Include="hayamiki_lib\model\types\hk_database.anubis" />
43 47 <Compile Include="hayamiki_lib\model\types\hk_datetime_field_attr.anubis" />
44   - <Compile Include="hayamiki_lib\model\types\hk_display.anubis" />
45   - <Compile Include="hayamiki_lib\model\types\hk_edit_view.anubis" />
  48 + <Compile Include="hayamiki_lib\model\types\hk_foreign_key_active_filter.anubis" />
  49 + <Compile Include="hayamiki_lib\model\types\hk_foreign_key_clause.anubis" />
  50 + <Compile Include="hayamiki_lib\model\types\hk_foreign_key_clause_on_directive.anubis" />
46 51 <Compile Include="hayamiki_lib\model\types\hk_help_text.anubis" />
47 52 <Compile Include="hayamiki_lib\model\types\hk_icon.anubis" />
48 53 <Compile Include="hayamiki_lib\model\types\hk_int_choice.anubis" />
49 54 <Compile Include="hayamiki_lib\model\types\hk_int_choices.anubis" />
50   - <Compile Include="hayamiki_lib\model\types\hk_list_view.anubis" />
51 55 <Compile Include="hayamiki_lib\model\types\hk_model.anubis" />
52 56 <Compile Include="hayamiki_lib\model\types\hk_model_attr.anubis" />
53 57 <Compile Include="hayamiki_lib\model\types\hk_model_column.anubis" />
54 58 <Compile Include="hayamiki_lib\model\types\hk_model_field.anubis" />
  59 + <Compile Include="hayamiki_lib\model\types\hk_on_conflict.anubis" />
  60 + <Compile Include="hayamiki_lib\model\types\hk_phone_field_attr.anubis" />
55 61 <Compile Include="hayamiki_lib\model\types\hk_table.anubis" />
56 62 <Compile Include="hayamiki_lib\model\types\hk_text_choice.anubis" />
57 63 <Compile Include="hayamiki_lib\model\types\hk_text_choices.anubis" />
58 64 <Compile Include="hayamiki_lib\model\types\hk_text_field_attr.anubis" />
59 65 <Compile Include="hayamiki_lib\types\hayamiki.anubis" />
  66 + <Compile Include="hayamiki_lib\view\hk_filter.anubis" />
  67 + <Compile Include="hayamiki_lib\view\jqgrid.anubis" />
  68 + <Compile Include="hayamiki_lib\view\load_vtm.anubis" />
  69 + <Compile Include="hayamiki_lib\view\types\hk_display.anubis" />
  70 + <Compile Include="hayamiki_lib\view\types\hk_editor.anubis" />
  71 + <Compile Include="hayamiki_lib\view\types\hk_editor_table.anubis" />
  72 + <Compile Include="hayamiki_lib\view\types\hk_filter.anubis" />
  73 + <Compile Include="hayamiki_lib\view\types\hk_fk_view.anubis" />
  74 + <Compile Include="hayamiki_lib\view\types\hk_form.anubis" />
  75 + <Compile Include="hayamiki_lib\view\types\hk_form_entry.anubis" />
  76 + <Compile Include="hayamiki_lib\view\types\hk_form_tab.anubis" />
  77 + <Compile Include="hayamiki_lib\view\types\hk_form_table.anubis" />
  78 + <Compile Include="hayamiki_lib\view\types\hk_view.anubis" />
  79 + <Compile Include="hayamiki_lib\view\types\hk_viewer.anubis" />
60 80 <Compile Include="hayamiki_lib\view\view_apps_renderer.anubis" />
  81 + <Compile Include="hayamiki_lib\view\view_editor_renderer.anubis" />
  82 + <Compile Include="hayamiki_lib\view\view_rows_import.anubis" />
61 83 <Compile Include="hayamiki_lib\view\view_table_manager.anubis" />
62 84 <Compile Include="hayamiki_lib\view\view_table_manager_types.anubis" />
63 85 <Compile Include="hayamiki_lib\view\view_table_renderer.anubis" />
64   - <Compile Include="hayamiki_lib\view\view_table_types.anubis" />
65 86 <Compile Include="hayamiki_lib\view\web_action.anubis" />
66 87 </ItemGroup>
67 88 <ItemGroup>
... ... @@ -72,5 +93,6 @@
72 93 <Folder Include="hayamiki_lib\model\types" />
73 94 <Folder Include="hayamiki_lib\types" />
74 95 <Folder Include="hayamiki_lib\view" />
  96 + <Folder Include="hayamiki_lib\view\types" />
75 97 </ItemGroup>
76 98 </Project>
77 99 \ No newline at end of file
... ...
hayamiki_generator.aproj
... ... @@ -147,6 +147,7 @@
147 147 <Compile Include="hayamiki_lib\model\types\hk_constraint.anubis" />
148 148 <Compile Include="hayamiki_lib\model\types\hk_database.anubis" />
149 149 <Compile Include="hayamiki_lib\model\types\hk_datetime_field_attr.anubis" />
  150 + <Compile Include="hayamiki_lib\model\types\hk_foreign_key_active_filter.anubis" />
150 151 <Compile Include="hayamiki_lib\model\types\hk_foreign_key_clause.anubis" />
151 152 <Compile Include="hayamiki_lib\model\types\hk_foreign_key_clause_on_directive.anubis" />
152 153 <Compile Include="hayamiki_lib\model\types\hk_help_text.anubis" />
... ... @@ -163,9 +164,11 @@
163 164 <Compile Include="hayamiki_lib\model\types\hk_text_choice.anubis" />
164 165 <Compile Include="hayamiki_lib\model\types\hk_text_choices.anubis" />
165 166 <Compile Include="hayamiki_lib\model\types\hk_text_field_attr.anubis" />
  167 + <Compile Include="hayamiki_lib\model\utils.anubis" />
166 168 <Compile Include="hayamiki_lib\types\hayamiki.anubis" />
167 169 <Compile Include="hayamiki_lib\view\hk_filter.anubis" />
168 170 <Compile Include="hayamiki_lib\view\jqgrid.anubis" />
  171 + <Compile Include="hayamiki_lib\view\load_vtm.anubis" />
169 172 <Compile Include="hayamiki_lib\view\view_apps_renderer.anubis" />
170 173 <Compile Include="hayamiki_lib\view\view_editor_renderer.anubis" />
171 174 <Compile Include="hayamiki_lib\view\view_rows_import.anubis" />
... ... @@ -524,6 +527,7 @@
524 527 <Compile Include="library\xml\basic_xml_parser.anubis" />
525 528 <Compile Include="library\xml\xml_parser.apg.anubis" />
526 529 <Compile Include="src\check.anubis" />
  530 + <Compile Include="src\generation\anubis.anubis" />
527 531 <Compile Include="src\generation\choices_selector.anubis" />
528 532 <Compile Include="src\generation\columns.anubis" />
529 533 <Compile Include="src\generation\create_table.anubis" />
... ...
hayamiki_lib @ c6bd97b105c
1   -Subproject commit 6b95d3a55ad17f9e884442211234e56ffd9735b6
  1 +Subproject commit c6bd97b105cf57b04fe2daf4482ba45e119c7b5d
... ...
src/check.anubis
... ... @@ -42,7 +42,7 @@ define Maybe(HK_Model_Column)
42 42 HK_Model_Column col
43 43 )=
44 44 since col is hk_column(name, type, attrib, help),
45   - if type is foreign_key(fk_app, fk_table, fields, fk_clause) then
  45 + if type is foreign_key(fk_app, fk_table, fields, active_filter, fk_clause) then
46 46 //TODO check for searchable fields if exists in foreign table
47 47 with mb_fk_app = if (fk_app) is
48 48 {
... ... @@ -59,7 +59,7 @@ define Maybe(HK_Model_Column)
59 59 if mb_fk_app is
60 60 {
61 61 failure then failure,
62   - success(n_fk_app) then success(hk_column(name, foreign_key(if (fk_app) is app_name(_) then app_name(n_fk_app) else fk_app, (if length(n_fk_app)>0 then n_fk_app+"_"else "")+fk_table, fields, fk_clause), attrib, help))
  62 + success(n_fk_app) then success(hk_column(name, foreign_key(if (fk_app) is app_name(_) then app_name(n_fk_app) else fk_app, (if length(n_fk_app)>0 then n_fk_app+"_"else "")+fk_table, fields, active_filter, fk_clause), attrib, help))
63 63 }
64 64 else
65 65 success(col).
... ...
src/generation/columns.anubis
... ... @@ -156,7 +156,7 @@ public define Maybe(String)
156 156 auto_now_add then
157 157 if insert then success(name) else failure
158 158 },
159   - foreign_key(_,_,_,_) then success(name),
  159 + foreign_key(_,_,_,_,_) then success(name),
160 160 integer_field(_) then success(name),
161 161 float_field then success(name),
162 162 char_field(_,_) then success(name),
... ... @@ -251,12 +251,12 @@ public define Maybe(String)
251 251 auto_now then success("information(\""+to_upper(col_name)+"\", \""+col_name+"\", "+type_name+"."+col_name+".datetime, 18, "+to_Anubis_source(help)+")"),
252 252 auto_now_add then success("information(\""+to_upper(col_name)+"\", \""+col_name+"\", "+type_name+"."+col_name+".datetime, 18, "+to_Anubis_source(help)+")")
253 253 },
254   - foreign_key(app,foreign_table,fields,_) then
  254 + foreign_key(app,foreign_table,fields,active_filters,_) then
255 255 if length(fields) = 0 then
256   - success("foreign_text(\""+to_upper(col_name)+"\", \""+col_name+"\", "+type_name+"."+col_name+", \""+foreign_table+"\", hk_form_selector(get_selector_"+foreign_table+"), "+to_Anubis_source(help)+")")
  256 + success("foreign_text(\""+to_upper(col_name)+"\", \""+col_name+"\", "+type_name+"."+col_name+", \""+foreign_table+"\", hk_form_selector(get_selector_"+foreign_table+"), "+to_Anubis_source(active_filters)+", "+to_Anubis_source(help)+")")
257 257 else
258 258 with search_fields = join(", ", map((String field) |-> "\""+field+"\"",fields)),
259   - success("foreign_text_search(\""+to_upper(col_name)+"\", \""+col_name+"\", "+type_name+"."+col_name+", \""+foreign_table+"\", ["+search_fields+"], "+to_Anubis_source(help)+")"),
  259 + success("foreign_text_search(\""+to_upper(col_name)+"\", \""+col_name+"\", "+type_name+"."+col_name+", \""+foreign_table+"\", ["+search_fields+"], "+to_Anubis_source(active_filters)+", "+to_Anubis_source(help)+")"),
260 260  
261 261 integer_field(choices) then
262 262 //success("integer(\""+to_upper(name)+"\", \""+name+"\", "+type_name+"."+name+", "+to_Anubis_source(help)+")"),
... ... @@ -334,7 +334,7 @@ public define String
334 334 date_field(attrs) then "to_String("+current_type_name+"."+name+")",
335 335 time_field(attrs) then "to_String("+current_type_name+"."+name+")",
336 336 datetime_field(attrs) then "to_String("+current_type_name+"."+name+")"
337   - foreign_key(app,foreign_table,_,_) then "get_"+foreign_table+"_show_string(db, "+current_type_name+"."+name+")",
  337 + foreign_key(app,foreign_table,_,_,_) then "get_"+foreign_table+"_show_string(db, "+current_type_name+"."+name+")",
338 338 integer_field(_) then "to_String("+current_type_name+"."+name+")",
339 339 float_field then "float_to_string("+current_type_name+"."+name+",5)",
340 340 char_field(_,_) then current_type_name+"."+name,
... ...
src/generation/extractor.anubis
... ... @@ -25,7 +25,7 @@ public define String
25 25 date_field(_) then "db_date(text"+cursor_index+")",
26 26 time_field(_) then "db_time(text"+cursor_index+")",
27 27 datetime_field(_) then "db_datetime(text"+cursor_index+")",
28   - foreign_key(_,_,_,_) then "db_id((Int)db_integer"+cursor_index+")",
  28 + foreign_key(_,_,_,_,_) then "db_id((Int)db_integer"+cursor_index+")",
29 29 integer_field(_) then "(Int)db_integer"+cursor_index,
30 30 float_field then "db_float"+cursor_index,
31 31 char_field(_,_) then "text"+cursor_index,
... ...
src/generation/fields.anubis
... ... @@ -30,7 +30,7 @@ public define String
30 30 date_field(_) then "DB_date",
31 31 time_field(_) then "DB_time",
32 32 datetime_field(_) then "DB_datetime",
33   - foreign_key(_,_,_,_) then "DB_id",
  33 + foreign_key(_,_,_,_,_) then "DB_id",
34 34 integer_field(_) then "Int",
35 35 float_field then "Float",
36 36 char_field(_,_) then "String",
... ... @@ -56,7 +56,7 @@ public define String
56 56 date_field(_) then "extern_type(\"DB_date\", \"calexium_lib/database/db_types.anubis\")",
57 57 time_field(_) then "extern_type(\"DB_time\", \"calexium_lib/database/db_types.anubis\")",
58 58 datetime_field(_) then "extern_type(\"DB_datetime\", \"calexium_lib/database/db_types.anubis\")",
59   - foreign_key(_,_,_,_) then "extern_type(\"DB_id\", \"calexium_lib/database/db_types.anubis\")",
  59 + foreign_key(_,_,_,_,_) then "extern_type(\"DB_id\", \"calexium_lib/database/db_types.anubis\")",
60 60 integer_field(_) then "int",
61 61 float_field then "float",
62 62 char_field(_,_) then "string",
... ... @@ -89,7 +89,7 @@ public define String
89 89 datetime_field(dt_attrs) then
90 90 with new_attributes = if dt_attrs is auto_now_add then [default("(datetime('now', 'LOCALTIME'))")] else attributes,
91 91 fill("DATETIME", 15) + format_attributes(new_attributes),
92   - foreign_key(app,fk,_,fk_clause) then fill("INTEGER", 15) + format_attributes(attributes)+" REFERENCES "+fk+"(id) "+format_fk_clause(fk_clause),
  92 + foreign_key(app,fk,_,_,fk_clause) then fill("INTEGER", 15) + format_attributes(attributes)+" REFERENCES "+fk+"(id) "+format_fk_clause(fk_clause),
93 93 integer_field(_) then fill("INTEGER", 15) + format_attributes(attributes),
94 94 float_field then fill("DOUBLE", 15) + format_attributes(attributes),
95 95 char_field(_,size) then fill("VARCHAR("+size+")", 15) + format_attributes(attributes),
... ... @@ -116,7 +116,7 @@ public define String
116 116 date_field(_) then "db_date(\"\")",
117 117 time_field(_) then "db_time(\"\")",
118 118 datetime_field(_) then "db_datetime(\"\")",
119   - foreign_key(_,_,_,_) then "(DB_id)none",
  119 + foreign_key(_,_,_,_,_) then "(DB_id)none",
120 120 integer_field(_) then "(Int)0",
121 121 float_field then "(Float)0.0",
122 122 char_field(choices,size) then "\"\"",
... ... @@ -161,7 +161,7 @@ public define String
161 161 else
162 162 ""
163 163 },
164   - foreign_key(_,_,_,_) then "bind_DB_id_or_NULL(\":v_"+name+"\", "+type_name+"."+name+")",
  164 + foreign_key(_,_,_,_,_) then "bind_DB_id_or_NULL(\":v_"+name+"\", "+type_name+"."+name+")",
165 165 integer_field(_) then "bind_Int(\":v_"+name+"\", "+type_name+"."+name+")",
166 166 float_field then "bind_Float(\":v_"+name+"\", "+type_name+"."+name+")",
167 167 char_field(_,_) then "bind_String"+or_null+"(\":v_"+name+"\", "+type_name+"."+name+")",
... ...
src/generation/header.anubis
... ... @@ -22,7 +22,7 @@ define Maybe(One)
22 22 [] then success(unique),
23 23 [h . t] then
24 24 since h is hk_column(_, type, _, _),
25   - if type is foreign_key(app, table_name, _, _) then
  25 + if type is foreign_key(app, table_name, _, _, _) then
26 26 if write_string(stream, "\nread database/generated/"+table_name+".anubis") is
27 27 {
28 28 failure then failure,
... ...
src/generation/html.anubis
... ... @@ -98,7 +98,7 @@ public define String
98 98 date_field(attrs) then to_HTML_cell_text(column, data_name, general_type_name),
99 99 time_field(attrs) then to_HTML_cell_text(column, data_name, general_type_name),
100 100 datetime_field(attrs) then to_HTML_cell_text(column, data_name, general_type_name),
101   - foreign_key(app, foreign_table,_,_) then to_HTML_cell_text(column, data_name, general_type_name),
  101 + foreign_key(app, foreign_table,_,_,_) then to_HTML_cell_text(column, data_name, general_type_name),
102 102 integer_field(choices) then to_HTML_cell_text(column, data_name, general_type_name),
103 103 float_field then to_HTML_cell_text(column, data_name, general_type_name),
104 104 char_field(choices, size) then to_HTML_cell_text(column, data_name, general_type_name),
... ...
src/generation/icons.anubis
... ... @@ -28,7 +28,7 @@ public define String
28 28 date_field(attrs) then icn16_clock,
29 29 time_field(attrs) then icn16_clock,
30 30 datetime_field(attrs) then icn16_clock,
31   - foreign_key(app,foreign_table,_,_) then icn16_question,
  31 + foreign_key(app,foreign_table,_,_,_) then icn16_question,
32 32 integer_field(choice) then icn16_question,
33 33 float_field then icn16_question,
34 34 char_field(choice, size) then icn16_question,
... ...
src/generation/json.anubis
... ... @@ -28,7 +28,7 @@ public define String
28 28 date_field(attrs) then "to_JSON_String(to_String("+current_type_name+"."+name+"))",
29 29 time_field(attrs) then "to_JSON_String(to_String("+current_type_name+"."+name+"))",
30 30 datetime_field(attrs) then "to_JSON_String(to_String("+current_type_name+"."+name+"))",
31   - foreign_key(app,foreign_table,_,_) then "to_JSON_String(get_"+foreign_table+"_show_string(db, "+current_type_name+"."+name+"))",
  31 + foreign_key(app,foreign_table,_,_,_) then "to_JSON_String(get_"+foreign_table+"_show_string(db, "+current_type_name+"."+name+"))",
32 32 integer_field(_) then current_type_name+"."+name,
33 33 float_field then "float_to_string("+current_type_name+"."+name+",5)",
34 34 char_field(_,_) then "to_JSON_String("+current_type_name+"."+name+")",
... ... @@ -62,7 +62,7 @@ public define String
62 62 date_field(attrs) then "json_member(\""+name+"\", json_string("+current_type_name+"."+name+"))",
63 63 time_field(attrs) then "json_member(\""+name+"\", json_string("+current_type_name+"."+name+"))",
64 64 datetime_field(attrs) then "json_member(\""+name+"\", json_string("+current_type_name+"."+name+"))",
65   - foreign_key(app,foreign_table,_,_) then "json_member(\""+name+"\", if resolve_fk then json_string(get_"+foreign_table+"_show_string(db, "+current_type_name+"."+name+"))) else json_int("+current_type_name+"."+name+")",
  65 + foreign_key(app,foreign_table,_,_,_) then "json_member(\""+name+"\", if resolve_fk then json_string(get_"+foreign_table+"_show_string(db, "+current_type_name+"."+name+"))) else json_int("+current_type_name+"."+name+")",
66 66 integer_field(_) then "json_member(\""+name+"\", json_int("+current_type_name+"."+name+"))",
67 67 float_field then "json_member(\""+name+"\", json_float("+current_type_name+"."+name+",5))",
68 68 char_field(_,_) then "json_member(\""+name+"\", json_string("+current_type_name+"."+name+"))",
... ... @@ -92,7 +92,7 @@ public define String
92 92 date_field(_) then "json_member(\""+name+"\", json_string(text"+cursor_index+"))",
93 93 time_field(_) then "json_member(\""+name+"\", json_string(text"+cursor_index+"))",
94 94 datetime_field(_) then "json_member(\""+name+"\", json_string(text"+cursor_index+"))",
95   - foreign_key(app,foreign_table,_,_) then
  95 + foreign_key(app,foreign_table,_,_,_) then
96 96 " if resolve_fk then\n"+
97 97 " json_member(\""+name+"\", json_string(get_"+foreign_table+"_show_string(db, db_id((Int)db_integer"+cursor_index+"))))\n"+
98 98 " else\n"+
... ...
src/generation/vt_view.anubis
... ... @@ -49,7 +49,7 @@ define String
49 49 date_field(attrs) then "date(\""+to_upper(name)+"\", \""+name+"\", "+to_Anubis_source(help)+")",
50 50 time_field(attrs) then "time(\""+to_upper(name)+"\", \""+name+"\", "+to_Anubis_source(help)+")",
51 51 datetime_field(attrs) then "datetime(\""+to_upper(name)+"\", \""+name+"\", "+to_Anubis_source(help)+")",
52   - foreign_key(app,foreign_table,_,_) then "foreign_text(\""+to_upper(name)+"\", \""+name+"\", hk_form_selector(get_selector_"+foreign_table+"), "+to_Anubis_source(help)+")",
  52 + foreign_key(app,foreign_table,_,active_filters,_) then "foreign_text(\""+to_upper(name)+"\", \""+name+"\", hk_form_selector(get_selector_"+foreign_table+"), "+to_Anubis_source(help)+")",
53 53 integer_field(choices) then
54 54 if choices is
55 55 {
... ...
src/generation/web_args.anubis
... ... @@ -26,7 +26,7 @@ public define String
26 26 date_field(attrs) then if attrs = none then "get_DB_date(lwa, __prefix__+\""+name+"\")" else "with "+name+" = get_dummy_DB_date,",
27 27 time_field(attrs) then if attrs = none then "get_DB_time(lwa, __prefix__+\""+name+"\")" else "with "+name+" = get_dummy_DB_time,",
28 28 datetime_field(attrs) then if attrs = none then "get_DB_datetime(lwa, __prefix__+\""+name+"\")" else "with "+name+" = get_dummy_DB_datetime,",
29   - foreign_key(_,_,_,_) then "with "+name+" = get_DB_id(lwa, __prefix__+\""+name+"\"),",
  29 + foreign_key(_,_,_,_,_) then "with "+name+" = get_DB_id(lwa, __prefix__+\""+name+"\"),",
30 30 integer_field(_) then "get_Int(lwa, __prefix__+\""+name+"\")",
31 31 float_field then "get_Float(lwa, __prefix__+\""+name+"\")",
32 32 char_field(_,_) then "get_String(lwa, __prefix__+\""+name+"\")",
... ... @@ -81,7 +81,7 @@ public define String
81 81 date_field(attrs) then if attrs = none then "get_DB_date(lwa, __prefix__+\""+name+"\", "+to_Anubis_default(col_type)+")," else "get_dummy_DB_date,",
82 82 time_field(attrs) then if attrs = none then "get_DB_time(lwa, __prefix__+\""+name+"\", "+to_Anubis_default(col_type)+")," else "get_dummy_DB_time,",
83 83 datetime_field(attrs) then if attrs = none then "get_DB_datetime(lwa, __prefix__+\""+name+"\", "+to_Anubis_default(col_type)+")," else "get_dummy_DB_datetime,",
84   - foreign_key(_,_,_,_) then "get_DB_id(lwa, __prefix__+\""+name+"\"),",
  84 + foreign_key(_,_,_,_,_) then "get_DB_id(lwa, __prefix__+\""+name+"\"),",
85 85 integer_field(_) then "get_Int(lwa, __prefix__+\""+name+"\", "+to_Anubis_default(col_type)+"),",
86 86 float_field then "get_Float(lwa, __prefix__+\""+name+"\", "+to_Anubis_default(col_type)+"),",
87 87 char_field(_,_) then "get_String(lwa, __prefix__+\""+name+"\", "+to_Anubis_default(col_type)+"),",
... ... @@ -195,7 +195,7 @@ public define String
195 195 auto_now then "[field(\""+name+"\", bind_Datetime(\":v_"+name+"\", db_now))]",
196 196 auto_now_add then "[]"
197 197 },
198   - foreign_key(_,_,_,_) then //"with "+name+" = get_DB_id(lwa, __prefix__+\""+name+"\"),",
  198 + foreign_key(_,_,_,_,_) then //"with "+name+" = get_DB_id(lwa, __prefix__+\""+name+"\"),",
199 199 "if get_mb_DB_id(lwa, __prefix__+\""+name+"\") is {failure then [], success("+name+") then [field(\""+name+"\", bind_DB_id_or_NULL(\":v_"+name+"\", "+name+"))] }"
200 200 integer_field(_) then //"get_Int(lwa, __prefix__+\""+name+"\")",
201 201 "if get_Int(lwa, __prefix__+\""+name+"\") is {failure then [], success("+name+") then [field(\""+name+"\", bind_Int(\":v_"+name+"\", "+name+"))] }"
... ...
src/main.anubis
... ... @@ -3,7 +3,7 @@
3 3 *
4 4 * *Title* Interfacing, generating and controling a database with Anubis
5 5 *
6   - * *Copyright* Copyright © David René 2015-2017.
  6 + * *Copyright* Copyright © David René 2015-2019.
7 7 *
8 8 *
9 9 *
... ...
src/model.3.0.0.anubis
... ... @@ -121,7 +121,7 @@ public define HK_Table production_production_table =
121 121 [
122 122  
123 123 hk_column("date", date_field(none), []),
124   - hk_column("assembler_id", foreign_key(app_name("staff"),"staff", [], []), []),
  124 + hk_column("assembler_id", foreign_key(app_name("staff"),"staff"), []),
125 125 hk_column("type_ref_id", foreign_key("type_number"), []),
126 126 hk_column("product_ref_id", foreign_key("product_reference"), []),
127 127 hk_column("site_id", foreign_key("production_site"), []),
... ...