2023-06-15 11:33:08 +02:00
|
|
|
use sea_orm::entity::prelude::*;
|
|
|
|
use serde::{Deserialize, Serialize};
|
2023-06-16 16:17:28 +02:00
|
|
|
use actix_admin::{prelude::*};
|
2023-06-15 11:33:08 +02:00
|
|
|
|
|
|
|
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Deserialize, Serialize, DeriveActixAdmin, DeriveActixAdminModel, DeriveActixAdminViewModel)]
|
|
|
|
#[sea_orm(table_name = "user")]
|
|
|
|
pub struct Model {
|
|
|
|
#[sea_orm(primary_key)]
|
|
|
|
#[serde(skip_deserializing)]
|
|
|
|
#[actix_admin(primary_key)]
|
|
|
|
pub id: i32,
|
|
|
|
pub name: String
|
|
|
|
}
|
|
|
|
|
|
|
|
impl ActiveModelBehavior for ActiveModel {}
|
|
|
|
|
|
|
|
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
|
|
|
pub enum Relation {}
|
|
|
|
|
2023-06-16 16:17:28 +02:00
|
|
|
impl ActixAdminModelValidationTrait<ActiveModel> for Entity {}
|
|
|
|
|
|
|
|
impl ActixAdminModelFilterTrait<Entity> for Entity {}
|