diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2019-08-10 17:45:58 +0200 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2019-08-10 17:45:58 +0200 |
commit | 0f03545b3c928fe209193c660dd550c33ae453a3 (patch) | |
tree | b0efb11bcd8ef994b486a9a63da961bb0141f5b4 /src | |
parent | d4feab5b0894464201824031fb077724fba060a0 (diff) | |
download | ramaskrik-social-0f03545b3c928fe209193c660dd550c33ae453a3.tar.gz ramaskrik-social-0f03545b3c928fe209193c660dd550c33ae453a3.tar.bz2 ramaskrik-social-0f03545b3c928fe209193c660dd550c33ae453a3.zip |
Add db::get_screeinings to get plain screening model.
Diffstat (limited to 'src')
-rw-r--r-- | src/db.rs | 5 | ||||
-rw-r--r-- | src/models.rs | 2 |
2 files changed, 6 insertions, 1 deletions
@@ -53,6 +53,11 @@ impl Connection { .execute(&**self) } + pub fn get_screenings(&self) -> QueryResult<Vec<models::Screening>> { + use crate::schema::screenings::dsl::*; + screenings.load(&**self) + } + pub fn get_aggregated_screenings(&self) -> QueryResult<Vec<models::AggregatedScreening>> { use crate::schema::screenings::dsl::*; let s = screenings diff --git a/src/models.rs b/src/models.rs index 2d49ad1..a009f4f 100644 --- a/src/models.rs +++ b/src/models.rs @@ -22,4 +22,4 @@ pub mod screening; pub use film::{Film, NewFilm}; pub use room::Room; -pub use screening::{AggregatedScreening, NewScreening}; +pub use screening::{AggregatedScreening, NewScreening, Screening}; |