From 8f6a4e1621aeb5a5b028674b436e35b3adc5c960 Mon Sep 17 00:00:00 2001 From: totoro Date: Tue, 25 May 2021 08:24:02 +0900 Subject: [PATCH] add an ide for the generator add some test table in model file --- hayamiki_generator.1.19.ide | 18 ++++++++++++++++++ src/model.3.0.0.anubis | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 hayamiki_generator.1.19.ide diff --git a/hayamiki_generator.1.19.ide b/hayamiki_generator.1.19.ide new file mode 100644 index 0000000..44050d6 --- /dev/null +++ b/hayamiki_generator.1.19.ide @@ -0,0 +1,18 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +# SharpDevelop 1.0.12.108 +Project("{B6712916-30DE-4a3e-A54C-2A79AC984AEE}") = "hayamiki_generator.1.19", "hayamiki_generator.1.19.aproj", "{89372B21-80FA-4EB8-B17C-072EB55713D6}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {89372B21-80FA-4EB8-B17C-072EB55713D6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {89372B21-80FA-4EB8-B17C-072EB55713D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {89372B21-80FA-4EB8-B17C-072EB55713D6}.Release|Any CPU.Build.0 = Release|Any CPU + {89372B21-80FA-4EB8-B17C-072EB55713D6}.Release|Any CPU.ActiveCfg = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/src/model.3.0.0.anubis b/src/model.3.0.0.anubis index b9ab53c..2170915 100644 --- a/src/model.3.0.0.anubis +++ b/src/model.3.0.0.anubis @@ -402,6 +402,64 @@ public define HK_Table address_book_contact_table = ). +public define HK_Text_Choices currency_position_choices = + text_choices( [ + hk_text_choice("after", "Après"), + hk_text_choice("before", "Avant"), + ]) +. + + +public define HK_Table currency_table = + hk_table("currency", + hk_model( + [ + hk_column("iso", char_field(3), [unique]), + hk_column("label", char_field(24), []), + hk_column("iso_num", char_field(3), []), + hk_column("symbol", char_field(5), []), + hk_column("rounding", integer_field, []), + hk_column("position", char_field(currency_position_choices, 16), [default("'after'")], help_text("Position du symbole de la devise. Avant ou Après le montant")), + hk_column("active", boolean_field, []), + ], + "obj.iso+\":'\"+obj.symbol+\"' \"+obj.label" + ), + hk_display( + //list_view + [ + list_view("default", ["label", "iso", "symbol", "iso_num", "rounding", "position", "active"]) + ], + //list_edit + [ /*edit_view_list_form("default", ["label", "iso", "symbol"])*/ + ] + ) + ). + +public define HK_Table currency_rate_table = + hk_table("currency_rate", + hk_model( + [ + hk_column("currency", foreign_key(app_name(""), "currency", ["iso", "__HK_SHOW_STRING__"]), []), + hk_column("amount", float_field, [not_null]), + hk_column("date", date_field(none), []), + ], + //List of constraint + [ + unique("unique_date_currency_rate", ["currency", "date"], replace) + ], + //show string + "\"\"" + ), + hk_display( + //list_view + [ + list_view("default", ["currency", "amount", "date"]) + ], + //list_edit + [ /*edit_view_list_form("default", ["label", "iso", "symbol"])*/ + ] + ) + ). public define HK_Database the_database_description @@ -431,6 +489,8 @@ public define HK_Database [ settings_table, django_admin_log_table, - address_book_contact_table + address_book_contact_table, + currency_table, + currency_rate_table ]) ]). -- libgit2 0.21.4