From 311b49a2fdd97b8b870dbaccccb55058ee0207c8 Mon Sep 17 00:00:00 2001 From: Melody Horn / boringcactus Date: Sun, 13 Jun 2021 16:33:46 -0600 Subject: lay groundwork for models --- src/apps.rs | 3 +++ src/contrib/admin/mod.rs | 6 ++++++ src/contrib/admin/site/mod.rs | 2 ++ src/db/mod.rs | 1 + src/db/models/mod.rs | 3 +++ src/lib.rs | 2 ++ src/settings.rs | 5 ++++- 7 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 src/apps.rs create mode 100644 src/db/mod.rs create mode 100644 src/db/models/mod.rs (limited to 'src') diff --git a/src/apps.rs b/src/apps.rs new file mode 100644 index 0000000..26c6124 --- /dev/null +++ b/src/apps.rs @@ -0,0 +1,3 @@ +pub struct AppConfig { + +} diff --git a/src/contrib/admin/mod.rs b/src/contrib/admin/mod.rs index 4d481aa..0f7e880 100644 --- a/src/contrib/admin/mod.rs +++ b/src/contrib/admin/mod.rs @@ -1 +1,7 @@ +use crate::apps::AppConfig; + pub mod site; + +pub const APP: AppConfig = AppConfig { + +}; diff --git a/src/contrib/admin/site/mod.rs b/src/contrib/admin/site/mod.rs index c8faf42..8448370 100644 --- a/src/contrib/admin/site/mod.rs +++ b/src/contrib/admin/site/mod.rs @@ -1 +1,3 @@ pub mod urls; + +pub use urls::urls; diff --git a/src/db/mod.rs b/src/db/mod.rs new file mode 100644 index 0000000..c446ac8 --- /dev/null +++ b/src/db/mod.rs @@ -0,0 +1 @@ +pub mod models; diff --git a/src/db/models/mod.rs b/src/db/models/mod.rs new file mode 100644 index 0000000..5e59949 --- /dev/null +++ b/src/db/models/mod.rs @@ -0,0 +1,3 @@ +pub use tosin_macros::Model; + +pub type Id = usize; diff --git a/src/lib.rs b/src/lib.rs index 38ae0e2..677d75d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,5 +1,7 @@ +pub mod apps; mod cli; pub mod contrib; +pub mod db; pub mod http; pub mod settings; pub mod urls; diff --git a/src/settings.rs b/src/settings.rs index 9d29cfe..9d34c0d 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -1,10 +1,13 @@ pub struct Settings { + pub installed_apps: &'static [&'static crate::apps::AppConfig], + pub database_url: &'static str, } impl Default for Settings { fn default() -> Self { Self { - + installed_apps: &[], + database_url: "", } } } -- cgit v1.2.3