commit dff6177158701d81d4b48a370730ebf68c24bb21
parent 4dd9a8a9db9d77c23343c8df6abc8b8b38cd652e
Author: Nikolas Mazur <nikolas@pop-os.localdomain>
Date: Wed, 8 Feb 2023 14:23:54 -0700
Fix datetime bug
Diffstat:
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/app/models.py b/app/models.py
@@ -104,7 +104,7 @@ class Time:
clockin = {
'_id': int,
'clock_in': Optional[datetime.datetime.utcnow],
- 'date': Optional[datetime.date],
+ 'date': Optional[datetime.datetime.today],
'project': str,
'note': str,
}
@@ -115,7 +115,7 @@ class Time:
clockout = {
'_id': int,
'clock_out': Optional[datetime.datetime.utcnow],
- 'date': Optional[datetime.date],
+ 'date': Optional[datetime.datetime.today],
'project': str,
'note': Optional[str],
'total_time': int
@@ -127,7 +127,7 @@ class Time:
# forign key
clock_in: Optional[datetime.datetime.utcnow] #System time Clock_out should be optional, but can clock_in?
modified_by: str #link to _id of user
- date: Optional [datetime.date]
+ date: Optional [datetime.datetime.today]
project: str
clock_out: Optional[datetime.datetime.utcnow] #System time
note: str
diff --git a/seeds.py b/seeds.py
@@ -66,7 +66,7 @@ user2 = {
time1 = {
'clock_in': datetime.datetime.utcnow(), #System time Clock_out should be optional, but can clock_in?
'modified_by': ['nikolasmmazur'], #link to _id of user
- 'date': datetime.date.today(), # Date at document submit
+ 'date': datetime.datetime.today(), # Date at document submit
'project': 'Project 2', #Probably link with projects foreign key
'clock_out': datetime.datetime.utcnow(), #System time
'note': 'Changed due to clocking out early',
@@ -77,7 +77,7 @@ time1 = {
time2 = {
'clock_in': datetime.datetime.utcnow(), #System time Clock_out should be optional, but can clock_in?
'modified_by': ['nikolasmmazur','brennentmazur'], #link to _id of user
- 'date': datetime.date.today(), # Date at document submit
+ 'date': datetime.datetime.today(), # Date at document submit
'project': 'Project 2', #Probably link with projects foreign key
'clock_out': datetime.datetime.utcnow(), #System time
'note': 'Changed due to clocking out early',
@@ -87,7 +87,7 @@ time2 = {
# Fleet documents
fleet1 = {
- 'date': datetime.date.today(),
+ 'date': datetime.datetime.today(),
'operator': 'brennentmazur', #forign key to userID
# 'safety_checks': True, #array for different safety checks
'additional_notes': 'Oil needs checked',
@@ -97,7 +97,7 @@ fleet1 = {
}
fleet2 = {
- 'date': datetime.date.today(),
+ 'date': datetime.datetime.today(),
'operator': 'nikolasmmazur', #forign key to userID
# 'safety_checks': True, #array for different safety checks
'additional_notes': 'Tires need replaced',
@@ -150,8 +150,8 @@ projects2 = {
# Insert documents
user_collection.insert_many([user1, user2])
-# time_collection.insert_many([time1, time2])
-# fleet_collection.insert_many([fleet1, fleet2])
+time_collection.insert_many([time1, time2])
+fleet_collection.insert_many([fleet1, fleet2])
agreement_collection.insert_many([agreement1, agreement2])
projects_collection.insert_many([projects1, projects2])