From 0f03545b3c928fe209193c660dd550c33ae453a3 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Sat, 10 Aug 2019 17:45:58 +0200 Subject: Add db::get_screeinings to get plain screening model. --- src/db.rs | 5 +++++ src/models.rs | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/db.rs b/src/db.rs index 59c4df3..60bbcde 100644 --- a/src/db.rs +++ b/src/db.rs @@ -53,6 +53,11 @@ impl Connection { .execute(&**self) } + pub fn get_screenings(&self) -> QueryResult> { + use crate::schema::screenings::dsl::*; + screenings.load(&**self) + } + pub fn get_aggregated_screenings(&self) -> QueryResult> { 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}; -- cgit v1.2.3