Added global settings module
This commit is contained in:
parent
efe22e1c1a
commit
158a31d8e0
13
finddates.py
13
finddates.py
@ -1,8 +1,13 @@
|
||||
import settings
|
||||
import fredmssql
|
||||
|
||||
|
||||
def get_birthdays(start, thru):
|
||||
db = fredmssql.FredDB(DATABASE_USER, DATABASE_PASS, DATABASE_NAME)
|
||||
db = fredmssql.FredDB(
|
||||
settings.DATABASE_USER,
|
||||
settings.DATABASE_PASS,
|
||||
settings.DATABASE_NAME
|
||||
)
|
||||
s = (" SELECT e.EmpUID, e.LastName, e.FirstName, e.BirthDate "
|
||||
" FROM Employee e "
|
||||
"LEFT JOIN EmpCstFV c ON e.EmpUID = c.EmpUID AND c.CstID = 105 "
|
||||
@ -26,7 +31,11 @@ def get_birthdays(start, thru):
|
||||
|
||||
|
||||
def get_anniversary(start, thru):
|
||||
db = fredmssql.FredDB(DATABASE_USER, DATABASE_PASS, DATABASE_NAME)
|
||||
db = fredmssql.FredDB(
|
||||
settings.DATABASE_USER,
|
||||
settings.DATABASE_PASS,
|
||||
settings.DATABASE_NAME
|
||||
)
|
||||
s = (" SELECT e.EmpUID, e.LastName, e.FirstName, e.HireDate "
|
||||
" FROM Employee e "
|
||||
"LEFT JOIN EmpCstFV c ON e.EmpUID = c.EmpUID AND c.CstID = 105 "
|
||||
|
12
settings.py
Normal file
12
settings.py
Normal file
@ -0,0 +1,12 @@
|
||||
import os
|
||||
from dotenv import load_dotenv
|
||||
|
||||
load_dotenv()
|
||||
|
||||
DATABASE_NAME = os.getenv("DATABASE_NAME")
|
||||
DATABASE_USER = os.getenv("DATABASE_USER")
|
||||
DATABASE_PASS = os.getenv("DATABASE_PASS")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
pass
|
@ -61,3 +61,4 @@ def get_date_range(date=''):
|
||||
|
||||
if __name__ == "__main__":
|
||||
pass
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user