Model Default not needed
This commit is contained in:
parent
1a780d8e4f
commit
8c354c6c92
@ -2,7 +2,7 @@ use crate::{ColumnTrait, QueryResult, TypeErr};
|
|||||||
pub use sea_query::Value;
|
pub use sea_query::Value;
|
||||||
use std::fmt::Debug;
|
use std::fmt::Debug;
|
||||||
|
|
||||||
pub trait ModelTrait: Clone + Debug + Default {
|
pub trait ModelTrait: Clone + Debug {
|
||||||
type Column: ColumnTrait;
|
type Column: ColumnTrait;
|
||||||
|
|
||||||
fn get(&self, c: Self::Column) -> Value;
|
fn get(&self, c: Self::Column) -> Value;
|
||||||
|
@ -5,7 +5,7 @@ use crate::entity::prelude::*;
|
|||||||
#[table = "cake"]
|
#[table = "cake"]
|
||||||
pub struct Entity;
|
pub struct Entity;
|
||||||
|
|
||||||
#[derive(Clone, Debug, Default, PartialEq, DeriveModel)]
|
#[derive(Clone, Debug, PartialEq, DeriveModel)]
|
||||||
pub struct Model {
|
pub struct Model {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
pub name: String,
|
pub name: String,
|
||||||
|
@ -5,7 +5,7 @@ use crate::entity::prelude::*;
|
|||||||
#[table = "fruit"]
|
#[table = "fruit"]
|
||||||
pub struct Entity;
|
pub struct Entity;
|
||||||
|
|
||||||
#[derive(Clone, Debug, Default, PartialEq, DeriveModel)]
|
#[derive(Clone, Debug, PartialEq, DeriveModel)]
|
||||||
pub struct Model {
|
pub struct Model {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
pub name: String,
|
pub name: String,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user