init feature

This commit is contained in:
arrelin
2025-12-24 15:38:36 +03:00
parent 0fdc20e750
commit fcd4199cbd
15 changed files with 994 additions and 2 deletions

View File

@@ -16,6 +16,8 @@ pub struct Model {
pub enum Relation {
#[sea_orm(has_many = "super::category::Entity")]
Category,
#[sea_orm(has_many = "super::shopping_item::Entity")]
ShoppingItem,
}
impl Related<super::category::Entity> for Entity {
@@ -24,4 +26,10 @@ impl Related<super::category::Entity> for Entity {
}
}
impl Related<super::shopping_item::Entity> for Entity {
fn to() -> RelationDef {
Relation::ShoppingItem.def()
}
}
impl ActiveModelBehavior for ActiveModel {}