init feature
This commit is contained in:
@@ -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 {}
|
||||
|
||||
Reference in New Issue
Block a user