From 38c3ed3f649d732afe2e0ec5724d5acc6a9795b7 Mon Sep 17 00:00:00 2001 From: SIMAILA Djalim Date: Tue, 3 Jan 2023 13:41:05 +0100 Subject: [PATCH] added data presets --- data_persistance/answer.py | 5 +++++ data_persistance/data.py | 25 +++++++++++++++++++++++++ data_persistance/locales.py | 5 +++++ data_persistance/npc.py | 5 +++++ data_persistance/places.py | 5 +++++ data_persistance/questions.py | 5 +++++ data_persistance/reactions.py | 5 +++++ data_persistance/traits.py | 5 +++++ 8 files changed, 60 insertions(+) create mode 100644 data_persistance/answer.py create mode 100644 data_persistance/data.py create mode 100644 data_persistance/locales.py create mode 100644 data_persistance/npc.py create mode 100644 data_persistance/places.py create mode 100644 data_persistance/questions.py create mode 100644 data_persistance/reactions.py create mode 100644 data_persistance/traits.py diff --git a/data_persistance/answer.py b/data_persistance/answer.py new file mode 100644 index 0000000..feeea97 --- /dev/null +++ b/data_persistance/answer.py @@ -0,0 +1,5 @@ +from tables import Answer + +ANSWER = [ + +] \ No newline at end of file diff --git a/data_persistance/data.py b/data_persistance/data.py new file mode 100644 index 0000000..4790677 --- /dev/null +++ b/data_persistance/data.py @@ -0,0 +1,25 @@ +from sqlalchemy import create_engine +from sqlalchemy.orm import Session +from tables import * + +from answer import ANSWER +from locales import LOCALES +from npc import NPCS +from places import PLACES +from questions import QUESTIONS +from reactions import REACTIONS +from traits import TRAITS + + +# Create Engine and tables +engine = create_engine("sqlite://", echo=True, future=True) +Base.metadata.create_all(engine) + +with Session(engine) as session: + session.add_all(ANSWER) + session.add_all(LOCALES) + session.add_all(NPCS) + session.add_all(PLACES) + session.add_all(QUESTIONS) + session.add_all(REACTIONS) + session.add_all(TRAITS) diff --git a/data_persistance/locales.py b/data_persistance/locales.py new file mode 100644 index 0000000..1ca2da1 --- /dev/null +++ b/data_persistance/locales.py @@ -0,0 +1,5 @@ +from tables import Locale + +LOCALES = [ + Locale(0,"EN", "Hello World"), +] diff --git a/data_persistance/npc.py b/data_persistance/npc.py new file mode 100644 index 0000000..e2ce341 --- /dev/null +++ b/data_persistance/npc.py @@ -0,0 +1,5 @@ +from tables import Npc + +NPCS = [ + +] \ No newline at end of file diff --git a/data_persistance/places.py b/data_persistance/places.py new file mode 100644 index 0000000..57b77fe --- /dev/null +++ b/data_persistance/places.py @@ -0,0 +1,5 @@ +from tables import Place + +PLACES = [ + +] \ No newline at end of file diff --git a/data_persistance/questions.py b/data_persistance/questions.py new file mode 100644 index 0000000..c6bfebc --- /dev/null +++ b/data_persistance/questions.py @@ -0,0 +1,5 @@ +from tables import Question + +QUESTIONS = [ + +] \ No newline at end of file diff --git a/data_persistance/reactions.py b/data_persistance/reactions.py new file mode 100644 index 0000000..534be94 --- /dev/null +++ b/data_persistance/reactions.py @@ -0,0 +1,5 @@ +from tables import Reaction + +REACTIONS = [ + +] \ No newline at end of file diff --git a/data_persistance/traits.py b/data_persistance/traits.py new file mode 100644 index 0000000..0eed597 --- /dev/null +++ b/data_persistance/traits.py @@ -0,0 +1,5 @@ +from tables import Trait + +TRAITS = [ + +] \ No newline at end of file