actix-admin/examples/basic/entity/user.rs

22 lines
673 B
Rust
Raw Normal View History

use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
2023-06-16 16:17:28 +02:00
use actix_admin::{prelude::*};
#[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 {}