added support for new morm api

- field(...) methods from Model take now FT structure instead of insertable/updatable/primary_key boolean flags
- table name is set in a prepare_table() method now
- added meta and admin_meta from ItemContent (morm has a field() method with PT::Space argument now)
This commit is contained in:
2021-03-11 18:48:18 +01:00
parent e8ba2a7bd1
commit bbc0a67153
8 changed files with 17 additions and 26 deletions

View File

@@ -56,23 +56,23 @@ void Item::map_fields()
int type_helper = static_cast<int>(type);
field(L"id", id, false, false, true);
field(L"id", id, morm::FT::no_insertable | morm::FT::no_updatable | morm::FT::primary_key);
field(L"parent_id", parent_id);
field(L"type", type_helper);
field(L"url", url);
field(L"subject", subject);
field(L"template", html_template);
field(L"sort_index", sort_index);
field(L"content_id", item_content, true, true, true);
field(L"content_id", item_content, morm::FT::foreign_key);
// may we should add a method setTypeFromInt(int t)?
type = static_cast<Type>(type_helper);
}
void Item::table_name(PT::TextStream & stream)
void Item::prepare_table()
{
stream << "core.item";
table(L"core", L"item");
}