read hayamiki_lib/types/hayamiki.anubis public define HK_Table settings_table = hk_table("settings", hk_model( [ hk_column("var_name", char_field(20), []), hk_column("var_value", char_field(20), []), ], "obj.var_name+\" = \"+obj.var_value" ), hk_display( //list_view [ list_view_all], //list edit [edit_view_all] ) ). public define HK_Table django_admin_log_table = hk_table("django_admin_log", hk_model( [ hk_column("action_time", datetime_field(auto_now_add), []), // hk_column("user_id", foreign_key("auth_user"), [indexed]), // hk_column("content_type_id", foreign_key("django_content_type"), [indexed]), hk_column("user_id", integer_field, []), hk_column("content_type_id", integer_field, []), hk_column("object_id", text_field, []), hk_column("object_repr", char_field(200), []), hk_column("action_flag", integer_field, []), hk_column("change_message", text_field, []), ], "obj.object_repr" ), hk_display( //list_view [ list_view_all], //list edit [ edit_view_all] ) ). public define HK_Table production_product_reference_table = hk_table("product_reference", hk_model( [ hk_column("type_ref_id", foreign_key("type_number"), []), hk_column("product_ref", char_field(4), []), hk_column("product_name", char_field(30), []), // hk_column("description", char_field(200), []), // hk_column("need_memory", boolean_field, []), // hk_column("need_power_supply", boolean_field, []), // hk_column("need_additional_storage", boolean_field, []), // hk_column("min_additional_storage", integer_field, []), // hk_column("max_additional_storage", integer_field, []), // hk_column("date_created", datetime_field(auto_now_add), []), hk_column("last_modified", datetime_field(auto_now), []), hk_column("comments", text_field, []) // whatever the user wants to keep ], "obj.product_ref+\":\"+obj.product_name" ), hk_display( //list_view [ list_view("default", ["type_ref_id", "product_ref", "product_name", "description"]) ], //list_edit [ edit_view_all] ) ). public define HK_Table production_products_table = hk_table("products", hk_model( [ hk_column("production_id", foreign_key("production"), []), hk_column("produced", boolean_field, []), // hk_column("date", date_field(none), []), hk_column("serial", char_field(50), []), // hk_column("security_code", char_field(50), []), // hk_column("motherboard_id", foreign_key("motherboard"), []), hk_column("storage_id", foreign_key("mass_storage"), []), hk_column("memory_id", foreign_key("memory"), []), hk_column("power_supply_id", foreign_key("power_supply"), []), hk_column("wifi", boolean_field, []), // hk_column("mac", char_field(20), []), hk_column("app_id", char_field(100), []), hk_column("os_version", char_field(20), []), hk_column("published", boolean_field, []), hk_column("publish_date", datetime_field(none), []), // hk_column("status", char_field(10), []), hk_column("date_created", datetime_field(auto_now_add), []), hk_column("last_modified", datetime_field(auto_now), []), hk_column("comments", text_field, []) // whatever the user wants to keep ], [ unique("", ["serial", "security_code"], ignore) ], "obj.serial" ), hk_display( //list_view [ list_view("default", ["production_id", "date", "serial", "motherboard_id", "app_id", "status"]) ], //list_edit [ edit_view_list_form("default", [ "production_id", "produced", "date", "serial", "security_code", "motherboard_id", "storage_id", "memory_id", "power_supply_id", "wifi", "mac", "app_id", "os_version", "published", "publish_date", "status", "date_created", "last_modified", "comments"])] ) ). public define HK_Table production_production_table = hk_table("production", hk_model( [ hk_column("date", date_field(none), []), hk_column("assembler_id", foreign_key(app_name("staff"),"staff", []), []), hk_column("type_ref_id", foreign_key("type_number"), []), hk_column("product_ref_id", foreign_key("product_reference"), []), hk_column("site_id", foreign_key("production_site"), []), hk_column("serial_prefix_id", foreign_key("serial_prefix"), []), hk_column("sticker_tpl_id", foreign_key("type_number"), []), hk_column("starting_index", integer_field, []), // hk_column("product_count", integer_field, []), // hk_column("produced_count", integer_field, []), // hk_column("completed", boolean_field, []), // hk_column("active", boolean_field, []), // hk_column("date_created", datetime_field(auto_now_add), []), hk_column("last_modified", datetime_field(auto_now), []), hk_column("comments", text_field, []) // whatever the user wants to keep ], "date(obj.date)" ), hk_display( //list_view [ list_view("default", ["date", "type_ref_id", "sticker_tpl_id", "product_ref_id", "site_id", "product_count", "produced_count"]) ], //list_edit [ edit_view_list_form("default", [ "date", "assembler_id", "type_ref_id", "product_ref_id", "site_id", "serial_prefix_id", "sticker_tpl_id", "starting_index", "product_count", "produced_count", "completed", "active", "date_created", "last_modified", "comments"])] ) ). public define HK_Table production_production_site_table = hk_table("production_site", hk_model( [ hk_column("ref", char_field(3), []), hk_column("name", char_field(50), []), hk_column("city", char_field(30), []), hk_column("country", char_field(30), []), hk_column("next_serial", integer_field, []), hk_column("date_created", datetime_field(auto_now_add), []), hk_column("last_modified", datetime_field(auto_now), []), hk_column("comments", text_field, []) // whatever the user wants to keep ], "obj.ref+\":\"+obj.name" ), hk_display( //list_view [ list_view("default", ["ref", "name", "city", "country"]) ], //list_edit [edit_view_all] ) ). public define HK_Table production_purchase_table = hk_table("purchase", hk_model( [ hk_column("date", date_field(none), []), hk_column("buyer_id", foreign_key(app_name("staff"),"staff", []), []), hk_column("supplier_id", foreign_key("supplier"), []), hk_column("order_ref", char_field(50), []), // hk_column("description", char_field(200), []), // description of the purchase hk_column("date_created", datetime_field(auto_now_add), []), hk_column("last_modified", datetime_field(auto_now), []), hk_column("comments", text_field, []), // whatever the user wants to keep ], "date(obj.date)" ), hk_display( //list_view [ list_view("default", ["date", "supplier_id", "description"]) ], //list_edit [edit_view_all] ) ). public define HK_Table production_serial_prefix_table = hk_table("serial_prefix", hk_model( [ hk_column("prefix", char_field(3), []), hk_column("next_start", integer_field, []) ], "obj.prefix" ), hk_display( //list_view [list_view_all], //list_edit [edit_view_all] ) ). public define HK_Table production_type_number_table = hk_table("type_number", hk_model( [ hk_column("type_ref", char_field(3), []), hk_column("description", text_field, []), hk_column("date_created", datetime_field(auto_now_add), []), hk_column("last_modified", datetime_field(auto_now), []), hk_column("comments", text_field, []) // whatever the user wants to keep ], "obj.type_ref+\":\"+obj.description" ), hk_display( //list_view [ list_view("default", ["type_ref", "description"]) ], //list_edit [ edit_view_list_form("default", ["type_ref", "description", "comments"])] ) ). public define HK_Table production_supplier_table = hk_table("supplier", hk_model( [ hk_column("company", char_field(100), []), hk_column("contact_id", foreign_key(none, "address_book_contact", []), []), hk_column("address1", char_field(100), []), hk_column("address2", char_field(100), []), hk_column("zipcode", char_field(10), []), hk_column("city", char_field(50), []), hk_column("country", char_field(50), []), hk_column("email", email_field, []), hk_column("url", url_field, []), hk_column("phone", phone_field(generic), []), hk_column("fax", char_field(20), []), hk_column("mobile", phone_field(cellphone), []), hk_column("siret", char_field(50), []), hk_column("tva_number", char_field(50), []), hk_column("date_created", datetime_field(auto_now_add), []), hk_column("last_modified", datetime_field(auto_now), []), hk_column("comments", text_field, []) // whatever the user wants to keep ], "obj.company" ), hk_display( //list_view [ list_view("default", ["company", "phone", "mobile", "email"]) ], //list_edit [ edit_view_list_form("default", ["company", "contact_id", "address1", "address2", "zipcode", "city", "country", "email", "url", "phone", "fax", "mobile", "siret", "tva_number", "date_created", "last_modified", "comments"])] ) ). public define HK_Table department_table = hk_table("department", hk_model( [ hk_column("name", char_field(50), []), hk_column("description", text_field, []), hk_column("date_created", datetime_field(auto_now_add), []), hk_column("last_modified", datetime_field(auto_now), []), hk_column("comments", text_field, []) // whatever the user wants to keep ], "obj.name" ), hk_display( //list_view [ list_view("default", ["name"]) ], //list_edit [ edit_view_list_form("default", ["name", "description", "comments"])] ) ). public define HK_Table role_table = hk_table("role", hk_model( [ hk_column("role_name", char_field(50), []), hk_column("description", text_field, []), hk_column("date_created", datetime_field(auto_now_add), []), hk_column("last_modified", datetime_field(auto_now), []), hk_column("comments", text_field, []) // whatever the user wants to keep ], "obj.role_name" ), hk_display( //list_view [ list_view("default", ["role_name"]) ], //list_edit [ edit_view_list_form("default", ["role_name", "description", "comments"]), form_table("table", table([ line([label([], "role_name"), column([], "role_name")]), line([empty([]), column([], "description")]), line([label([], "comments"), column([], "comments")]), line([table([colspan(2)],[line( [label([], "date_created"),column([], "date_created"),label([], "last_modified"),column([], "last_modified")])])]) ]) ) ] ) ). public define HK_Table staff_table = hk_table("staff", hk_model( [ hk_column("contact_id", foreign_key(none, "address_book_contact", []), []), hk_column("department_id", foreign_key("department"), []), hk_column("role_id", foreign_key("role"), []), hk_column("email", email_field, []), hk_column("incoming_date", date_field(none), []), // hk_column("outgoing_date", date_field(none), [], help_text("if not still present in company. The date of official outgoing")), // hk_column("still_present", boolean_field, [], help_text("Still working for the company")), hk_column("date_created", datetime_field(auto_now_add), []), hk_column("last_modified", datetime_field(auto_now), []), hk_column("comments", text_field, []) // whatever the user wants to keep ], "obj.email" ), hk_display( //list_view [ list_view("default", ["contact_id", "department_id", "role_id", "email"], [hk_filter("présent", "still_present = 1")] ), list_view("details", ["contact_id", "department_id", "role_id", "email", "incoming_date", "still_present"]) ], //list_edit [ edit_view_list_form("default", ["contact_id", "department_id", "role_id", "email", "incoming_date", "outgoing_date", "still_present", "date_created", "last_modified", "comments"])] ) ). public define HK_Table address_book_contact_table = hk_table("address_book_contact", hk_model( [ hk_column("first_name", char_field(50), []), hk_column("last_name", char_field(50), []), hk_column("company", char_field(100), []), hk_column("role", char_field(50), []), hk_column("address1", char_field(100), []), hk_column("address2", char_field(100), []), hk_column("zipcode", char_field(10), []), hk_column("city", char_field(50), []), hk_column("country", char_field(50), []), hk_column("email", email_field, []), hk_column("url", url_field, []), hk_column("phone", phone_field(landline), []), hk_column("fax", char_field(20), []), hk_column("mobile", phone_field(cellphone), []), hk_column("date_created", datetime_field(auto_now_add), []), hk_column("last_modified", datetime_field(auto_now), []), hk_column("comments", text_field, []) // whatever the user wants to keep ], "obj.first_name +\" \"+obj.last_name " ), hk_display( //list_view [ list_view("short", ["first_name", "last_name", "company"]), list_view("default", ["first_name", "last_name", "company", "phone", "mobile", "email"]), list_view("details", ["first_name", "last_name", "company", "url", "role", "phone", "mobile", "email", "address1", "address2", "zipcode", "city", "country"]) ], //list_edit [ edit_view_list_form("default", ["first_name", "last_name", "company", "role", "address1", "address2", "zipcode", "city", "country", "email", "url", "phone", "fax", "mobile", "comments"])] ) ). public define HK_Database the_database_description = hk_database("prod_manager", [ //domain manager //mf_serial_table hk_app("production", [ production_product_reference_table, production_production_table, production_production_site_table, production_products_table, production_purchase_table, production_serial_prefix_table, production_type_number_table, production_supplier_table ]), hk_app("staff", [ department_table, staff_table, role_table, ]), hk_app("", [ settings_table, django_admin_log_table, address_book_contact_table ]) ]).