Removing more bad columns.
This commit is contained in:
parent
eac9a3c7bb
commit
933ed0cb17
2 changed files with 2 additions and 12 deletions
|
|
@ -64,12 +64,9 @@ class WorkLog(db.Model, ImageAttachable, CrudMixin):
|
||||||
'id': self.id,
|
'id': self.id,
|
||||||
'start_time': self.start_time.isoformat() if self.start_time else None,
|
'start_time': self.start_time.isoformat() if self.start_time else None,
|
||||||
'end_time': self.end_time.isoformat() if self.end_time else None,
|
'end_time': self.end_time.isoformat() if self.end_time else None,
|
||||||
'notes': self.notes,
|
|
||||||
'updates': [note.serialize() for note in self.updates or []],
|
'updates': [note.serialize() for note in self.updates or []],
|
||||||
'complete': self.complete,
|
'complete': self.complete,
|
||||||
'followup': self.followup,
|
|
||||||
'contact_id': self.contact_id,
|
'contact_id': self.contact_id,
|
||||||
'analysis': self.analysis,
|
|
||||||
'work_item_id': self.work_item_id
|
'work_item_id': self.work_item_id
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -93,10 +90,7 @@ class WorkLog(db.Model, ImageAttachable, CrudMixin):
|
||||||
return cls(
|
return cls(
|
||||||
start_time=datetime.datetime.fromisoformat(str(start_time_str)) if start_time_str else datetime.datetime.now(),
|
start_time=datetime.datetime.fromisoformat(str(start_time_str)) if start_time_str else datetime.datetime.now(),
|
||||||
end_time=datetime.datetime.fromisoformat(str(end_time_str)) if end_time_str else None,
|
end_time=datetime.datetime.fromisoformat(str(end_time_str)) if end_time_str else None,
|
||||||
notes=data.get("notes"), # Soon to be removed and sent to a farm upstate
|
|
||||||
complete=bool(data.get("complete", False)),
|
complete=bool(data.get("complete", False)),
|
||||||
followup=bool(data.get("followup", False)),
|
|
||||||
analysis=bool(data.get("analysis", False)),
|
|
||||||
contact_id=data.get("contact_id"),
|
contact_id=data.get("contact_id"),
|
||||||
work_item_id=data.get("work_item_id"),
|
work_item_id=data.get("work_item_id"),
|
||||||
updates=updates
|
updates=updates
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ def list_worklog():
|
||||||
header=worklog_headers,
|
header=worklog_headers,
|
||||||
model_name='worklog',
|
model_name='worklog',
|
||||||
title="Work Log",
|
title="Work Log",
|
||||||
fields = ['contact.identifier', 'work_item.identifier', 'start_time', 'end_time', 'complete', 'followup', 'analysis'],
|
fields = ['contact.identifier', 'work_item.identifier', 'start_time', 'end_time', 'complete'],
|
||||||
entry_route='worklog_item',
|
entry_route='worklog_item',
|
||||||
csv_route='worklog'
|
csv_route='worklog'
|
||||||
)
|
)
|
||||||
|
|
@ -64,8 +64,7 @@ def new_worklog():
|
||||||
items = sorted(items, key=lambda i: i.identifier)
|
items = sorted(items, key=lambda i: i.identifier)
|
||||||
|
|
||||||
log = WorkLog(
|
log = WorkLog(
|
||||||
start_time=datetime.datetime.now(),
|
start_time=datetime.datetime.now()
|
||||||
followup=True
|
|
||||||
)
|
)
|
||||||
|
|
||||||
return render_template(
|
return render_template(
|
||||||
|
|
@ -104,8 +103,6 @@ def update_worklog(id):
|
||||||
log.start_time = datetime.datetime.fromisoformat(data.get("start_time")) if data.get("start_time") else log.start_time
|
log.start_time = datetime.datetime.fromisoformat(data.get("start_time")) if data.get("start_time") else log.start_time
|
||||||
log.end_time = datetime.datetime.fromisoformat(data.get("end_time")) if data.get("end_time") else log.end_time
|
log.end_time = datetime.datetime.fromisoformat(data.get("end_time")) if data.get("end_time") else log.end_time
|
||||||
log.complete = bool(data.get("complete", log.complete))
|
log.complete = bool(data.get("complete", log.complete))
|
||||||
log.followup = bool(data.get("followup", log.followup))
|
|
||||||
log.analysis = bool(data.get("analysis", log.analysis))
|
|
||||||
log.contact_id = data.get("contact_id", log.contact_id)
|
log.contact_id = data.get("contact_id", log.contact_id)
|
||||||
log.work_item_id = data.get("work_item_id", log.work_item_id)
|
log.work_item_id = data.get("work_item_id", log.work_item_id)
|
||||||
existing = {str(note.id): note for note in log.updates}
|
existing = {str(note.id): note for note in log.updates}
|
||||||
|
|
@ -179,7 +176,6 @@ def get_worklog_csv():
|
||||||
"start_time",
|
"start_time",
|
||||||
"end_time",
|
"end_time",
|
||||||
"complete",
|
"complete",
|
||||||
"followup",
|
|
||||||
"contact",
|
"contact",
|
||||||
"work_item",
|
"work_item",
|
||||||
"analysis",
|
"analysis",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue