aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2019-08-10 17:45:58 +0200
committerHarald Eilertsen <haraldei@anduin.net>2019-08-10 17:45:58 +0200
commit0f03545b3c928fe209193c660dd550c33ae453a3 (patch)
treeb0efb11bcd8ef994b486a9a63da961bb0141f5b4 /src
parentd4feab5b0894464201824031fb077724fba060a0 (diff)
downloadramaskrik-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.rs5
-rw-r--r--src/models.rs2
2 files changed, 6 insertions, 1 deletions
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<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};