use crate::models::PhotoSet; use crate::schema::photo_sets; #[derive(Insertable, AsChangeset)] #[table_name = "photo_sets"] pub struct PhotoSetForm { pub id: i32, pub original: String, pub fullsize: String, pub base: String, pub thumbnail: String, } impl From for PhotoSetForm { fn from(p: PhotoSet) -> Self { Self { id: p.id.unwrap_or(-1), original: p.original.id, fullsize: p.fullsize.id, base: p.base.id, thumbnail: p.thumbnail.id, } } }