diff options
author | Markus Krogh <markus@nordu.net> | 2016-03-10 11:53:42 +0000 |
---|---|---|
committer | Markus Krogh <markus@nordu.net> | 2016-03-10 11:53:42 +0000 |
commit | 4575c7ea47680e7f589477c917a73353d6faef73 (patch) | |
tree | 5f1fb1d8d120b8d609b2018a5eb8e8ad30183952 /maconomy/repositories.py | |
parent | 67abade3147d6d706c18beaac219d549fb71c35e (diff) |
Manager mail + ceo mail
Diffstat (limited to 'maconomy/repositories.py')
-rw-r--r-- | maconomy/repositories.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/maconomy/repositories.py b/maconomy/repositories.py index fb143e8..2dcb019 100644 --- a/maconomy/repositories.py +++ b/maconomy/repositories.py @@ -1,5 +1,5 @@ import cx_Oracle -from maconomy.models import Employee, Timesheet +from maconomy.models import Timesheet def create_db(config): user = config.get("db", "user") @@ -17,7 +17,7 @@ class DBRepository: class TimeRegistrationRepository(DBRepository): def all_active(self): - query = """SELECT e.EMPLOYEENUMBER,e.NAME1,e.ELECTRONICMAILADDRESS, t.WEEKNUMBER, t.SUBMITTED, t.APPROVED from EMPLOYEE e + query = """SELECT e.EMPLOYEENUMBER,e.NAME1,e.ELECTRONICMAILADDRESS, t.WEEKNUMBER, t.SUBMITTED, t.APPROVED, e.SUPERIOREMPLOYEE from EMPLOYEE e LEFT OUTER JOIN TIMESHEETHEADER t ON e.EMPLOYEENUMBER = t.EMPLOYEENUMBER and t.PERIODSTART=to_char(trunc(sysdate-7, 'IW'),'YYYY.MM.DD') @@ -31,5 +31,5 @@ class TimeRegistrationRepository(DBRepository): res = self.cursor.execute(query) rows = res.fetchall() - return [(Employee(r), Timesheet(r[3:])) for r in rows] + return [Timesheet.from_result(r) for r in rows] |