add model template

This commit is contained in:
2025-04-14 13:50:36 +04:00
parent 68d77a23e4
commit 3c58ffbb36
2 changed files with 29 additions and 1 deletions

View File

@@ -1 +1,20 @@
{% if config.prelude %}
use {{prelude_path}}::*;
use sea_orm::ActiveModelBehavior;
#[async_trait::async_trait]
impl ActiveModelBehavior for {{pascalCase(table_name)}}ActiveModel {}
impl {{pascalCase(table_name)}}Model {}
impl {{pascalCase(table_name)}}ActiveModel {}
{% else %}
use {{entities_path}}::{{table_name}}::{ActiveModel, Model, Entity};
#[async_trait::async_trait]
impl ActiveModelBehavior for ActiveModel {}
impl Model {}
impl ActiveModel {}
{% endif %}