Commit 8f6a4e1621aeb5a5b028674b436e35b3adc5c960
1 parent
6f3e0e50
add an ide for the generator
add some test table in model file
Showing
2 changed files
with
79 additions
and
1 deletions
Show diff stats
| 1 | + | |
| 2 | +Microsoft Visual Studio Solution File, Format Version 9.00 | |
| 3 | +# Visual Studio 2005 | |
| 4 | +# SharpDevelop 1.0.12.108 | |
| 5 | +Project("{B6712916-30DE-4a3e-A54C-2A79AC984AEE}") = "hayamiki_generator.1.19", "hayamiki_generator.1.19.aproj", "{89372B21-80FA-4EB8-B17C-072EB55713D6}" | |
| 6 | +EndProject | |
| 7 | +Global | |
| 8 | + GlobalSection(SolutionConfigurationPlatforms) = preSolution | |
| 9 | + Debug|Any CPU = Debug|Any CPU | |
| 10 | + Release|Any CPU = Release|Any CPU | |
| 11 | + EndGlobalSection | |
| 12 | + GlobalSection(ProjectConfigurationPlatforms) = postSolution | |
| 13 | + {89372B21-80FA-4EB8-B17C-072EB55713D6}.Debug|Any CPU.Build.0 = Debug|Any CPU | |
| 14 | + {89372B21-80FA-4EB8-B17C-072EB55713D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | |
| 15 | + {89372B21-80FA-4EB8-B17C-072EB55713D6}.Release|Any CPU.Build.0 = Release|Any CPU | |
| 16 | + {89372B21-80FA-4EB8-B17C-072EB55713D6}.Release|Any CPU.ActiveCfg = Release|Any CPU | |
| 17 | + EndGlobalSection | |
| 18 | +EndGlobal | ... | ... |
src/model.3.0.0.anubis
| ... | ... | @@ -402,6 +402,64 @@ public define HK_Table address_book_contact_table = |
| 402 | 402 | ). |
| 403 | 403 | |
| 404 | 404 | |
| 405 | +public define HK_Text_Choices currency_position_choices = | |
| 406 | + text_choices( [ | |
| 407 | + hk_text_choice("after", "Après"), | |
| 408 | + hk_text_choice("before", "Avant"), | |
| 409 | + ]) | |
| 410 | +. | |
| 411 | + | |
| 412 | + | |
| 413 | +public define HK_Table currency_table = | |
| 414 | + hk_table("currency", | |
| 415 | + hk_model( | |
| 416 | + [ | |
| 417 | + hk_column("iso", char_field(3), [unique]), | |
| 418 | + hk_column("label", char_field(24), []), | |
| 419 | + hk_column("iso_num", char_field(3), []), | |
| 420 | + hk_column("symbol", char_field(5), []), | |
| 421 | + hk_column("rounding", integer_field, []), | |
| 422 | + 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")), | |
| 423 | + hk_column("active", boolean_field, []), | |
| 424 | + ], | |
| 425 | + "obj.iso+\":'\"+obj.symbol+\"' \"+obj.label" | |
| 426 | + ), | |
| 427 | + hk_display( | |
| 428 | + //list_view | |
| 429 | + [ | |
| 430 | + list_view("default", ["label", "iso", "symbol", "iso_num", "rounding", "position", "active"]) | |
| 431 | + ], | |
| 432 | + //list_edit | |
| 433 | + [ /*edit_view_list_form("default", ["label", "iso", "symbol"])*/ | |
| 434 | + ] | |
| 435 | + ) | |
| 436 | + ). | |
| 437 | + | |
| 438 | +public define HK_Table currency_rate_table = | |
| 439 | + hk_table("currency_rate", | |
| 440 | + hk_model( | |
| 441 | + [ | |
| 442 | + hk_column("currency", foreign_key(app_name(""), "currency", ["iso", "__HK_SHOW_STRING__"]), []), | |
| 443 | + hk_column("amount", float_field, [not_null]), | |
| 444 | + hk_column("date", date_field(none), []), | |
| 445 | + ], | |
| 446 | + //List of constraint | |
| 447 | + [ | |
| 448 | + unique("unique_date_currency_rate", ["currency", "date"], replace) | |
| 449 | + ], | |
| 450 | + //show string | |
| 451 | + "\"\"" | |
| 452 | + ), | |
| 453 | + hk_display( | |
| 454 | + //list_view | |
| 455 | + [ | |
| 456 | + list_view("default", ["currency", "amount", "date"]) | |
| 457 | + ], | |
| 458 | + //list_edit | |
| 459 | + [ /*edit_view_list_form("default", ["label", "iso", "symbol"])*/ | |
| 460 | + ] | |
| 461 | + ) | |
| 462 | + ). | |
| 405 | 463 | |
| 406 | 464 | public define HK_Database |
| 407 | 465 | the_database_description |
| ... | ... | @@ -431,6 +489,8 @@ public define HK_Database |
| 431 | 489 | [ |
| 432 | 490 | settings_table, |
| 433 | 491 | django_admin_log_table, |
| 434 | - address_book_contact_table | |
| 492 | + address_book_contact_table, | |
| 493 | + currency_table, | |
| 494 | + currency_rate_table | |
| 435 | 495 | ]) |
| 436 | 496 | ]). | ... | ... |