Skip to content

Commit ae56fe5

Browse files
feat: integrate peewee as ORM library
1 parent 24ff705 commit ae56fe5

14 files changed

Lines changed: 83 additions & 20 deletions

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Created by https://www.gitignore.io/api/python
22
# Edit at https://www.gitignore.io/?templates=python
33

4+
### Project ###
5+
*.db
6+
47
### PyCharm ###
58
.idea
69

Pipfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ mypy = "*"
1616
pre-commit = "*"
1717
pytest = "*"
1818
pytest-cov = "*"
19+
peewee = "*"

Pipfile.lock

Lines changed: 11 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

home_guardian/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import logging.config
2+
3+
from home_guardian.function_collection import get_root_path
4+
5+
# Set up logging
6+
logging_conf_path = f"{get_root_path()}/logging.conf"
7+
print(f"logging_conf_path = {logging_conf_path}, __file__ = {__file__}")
8+
logging.config.fileConfig(logging_conf_path)

home_guardian/__main__.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
import logging.config
2-
from os import path
3-
import sys
2+
import random
43

5-
from home_guardian.home_guardian import fib
6-
7-
# Set up logging
8-
logging_conf_path = path.join(path.dirname(path.abspath(__file__)), "logging.conf")
9-
print(f"logging_conf_path = {logging_conf_path}, __file__ = {__file__}")
10-
logging.config.fileConfig(logging_conf_path)
4+
from home_guardian.repository.user_repository import create_user
115

6+
log = logging.getLogger("rotatingFileLogger")
127
if __name__ == "__main__":
13-
n = int(sys.argv[1])
14-
print(fib(n))
8+
create_user(f"user{random.random()}")
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import os
2+
3+
_current_file = os.path.abspath(__file__)
4+
5+
6+
def get_root_path() -> str: return os.path.dirname(_current_file)

home_guardian/home_guardian.py

Lines changed: 0 additions & 5 deletions
This file was deleted.

home_guardian/repository/__init__.py

Whitespace-only changes.

home_guardian/repository/model/__init__.py

Whitespace-only changes.

home_guardian/repository/model/base/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)