From 412efb6d93436b5c70efbf17f9eb15c91dcb79e8 Mon Sep 17 00:00:00 2001 From: chriswebb09 Date: Fri, 15 Dec 2023 09:21:20 -0500 Subject: [PATCH] cleanup code --- DirectReport/browserview/reportbp.py | 4 ++- DirectReport/datadependencies/prompts.py | 43 ------------------------ DirectReport/models/entry.py | 4 +-- DirectReport/models/team_member_model.py | 1 + DirectReport/models/team_model.py | 1 + 5 files changed, 6 insertions(+), 47 deletions(-) diff --git a/DirectReport/browserview/reportbp.py b/DirectReport/browserview/reportbp.py index 4febb681..41ebfce7 100644 --- a/DirectReport/browserview/reportbp.py +++ b/DirectReport/browserview/reportbp.py @@ -52,6 +52,7 @@ def team_report(): if request.method == "POST": json_data = request.get_json() report_model = ReportModel(json_data["id"], json_data['summary'], json_data['created_at']) + print(report_model) return render_template('team/teamreport.html', title='Team Report', data=[]) @@ -74,7 +75,8 @@ def detail(uid=None): json_data["id"], json_data['entry'], json_data['topic'], json_data['created_at'], json_data['week_id'] ) entry = item.get_entry(uid).to_dict() - return render_template('detail.html', title='Detail', data=reportJSON) + print(entry) + return render_template('detail.html', title='Detail', data=entry) @reportsbp.route("/getreport/", methods=['GET']) diff --git a/DirectReport/datadependencies/prompts.py b/DirectReport/datadependencies/prompts.py index 8f8f3a52..e5a0d9b4 100644 --- a/DirectReport/datadependencies/prompts.py +++ b/DirectReport/datadependencies/prompts.py @@ -1,44 +1 @@ #!/usr/bin/env python3 - -global GENERATE_EMAIL_PROMPT_PREFIX -global GENERATE_SUMMARY_PROMPT_PREIX - -GENERATE_EMAIL_PROMPT_PREFIX = ( - "can you take this data and summarize in professional manner for an email on the team status for my manager?\n" - + "Data: " -) -GENERATE_SUMMARY_PROMPT_PREIX = ( - "can you provide a short summary of what what was accomplished overall along with the time frame it was accomplished in, please categorize the majors improvements in areas_of__focus and please provide individual breakdown based on the following list of team members, list each contributor as a team member, and work using the following " - + "Format: \n" - + "{ \n" - + "'team'" - + ": [{" - + "\n 'name'" - + ": '', " - + "\n 'accomplishments'" - + ": '' " - + " ," - + "\n 'commits'" - + ": '' \n" - + "}]," - + "\n'report'" - + ": {" - + "\n 'summary'" - + ": ''" - + ", \n 'highlights'" - + ": [{" - + "\n 'title'" - + ": '' ," - + "\n 'description'" - + ": '' " - + "\n }], \n" - + "'areas_of_focus'" - + ": [], \n" - + " 'conclusion'" - + ": ''" - + "\n}" - + "\n}" - + "\n" - " under no circumstances show the reponse include triple single quotes or extraneous newline characters the response data must use double quotes not single quote. The highlights section must be included in own element outside of the summary, THE RESPONSE MUST BE PROPERLY FORMATTED JSON " - + "Data:" -) diff --git a/DirectReport/models/entry.py b/DirectReport/models/entry.py index 77812980..0b647ef1 100644 --- a/DirectReport/models/entry.py +++ b/DirectReport/models/entry.py @@ -22,8 +22,6 @@ def __init__(self, uuid, topic, message, created_at, modified_on): :type created_at: float :param modified_on: The timestamp when the entry was last modified. :type modified_on: float - :param week_uuid: The unique identifier for the week. - :type week_uuid: str """ self.uuid = uuid self.topic = topic @@ -79,7 +77,7 @@ def from_dict(cls, data): message = data.get("message") created_at = datetime.datetime.fromisoformat(data.get("created_at")).timestamp() modified_on = datetime.datetime.fromisoformat(data.get("modified_on")).timestamp() - return cls(uuid, topic, message, created_at, modified_on, week_uuid) + return cls(uuid, topic, message, created_at, modified_on) def mark_modified(self): """ diff --git a/DirectReport/models/team_member_model.py b/DirectReport/models/team_member_model.py index 61679c5a..416f9686 100644 --- a/DirectReport/models/team_member_model.py +++ b/DirectReport/models/team_member_model.py @@ -2,6 +2,7 @@ import sqlite3 import uuid +from .team_member import TeamMember class TeamMemberModel: diff --git a/DirectReport/models/team_model.py b/DirectReport/models/team_model.py index 10a4bac7..f8c35c3b 100644 --- a/DirectReport/models/team_model.py +++ b/DirectReport/models/team_model.py @@ -2,6 +2,7 @@ import sqlite3 import uuid +from .team import Team class TeamModel: