diff --git a/compair/api/assignment_search_enddate.py b/compair/api/assignment_search_enddate.py index ae39bf5df..ccf2c616f 100644 --- a/compair/api/assignment_search_enddate.py +++ b/compair/api/assignment_search_enddate.py @@ -48,10 +48,6 @@ def get(self): search_date_assignment_parser.add_argument('compare_end', default=datetime.now().strftime("%Y-%m-%d")) args = search_date_assignment_parser.parse_args() - ##print("XXXXXXXXXX-RequestParser-compare_start:" + str(args['compare_start'])) - ##print(validate(args['compare_start'])) - ##print(validate(args['compare_end'])) - end_date = datetime.now().strftime("%Y-%m-%d") start_date = datetime.now().strftime("%Y-%m-%d") @@ -61,22 +57,12 @@ def get(self): if validate(args['compare_start']): start_date = str(args['compare_start']) - ##print("XXXXXXXXXXYYY START_DATE:" + str(start_date)) - ##print("XXXXXXXXXXYYY END_DATEEEEEE:" + str(end_date)) - - - ##db1.db_url - ##'SQLALCHEMY_DATABASE_URI': 'mysql+pymysql://compair:compair@db:3306/compair?charset=utf8mb4' - ##str(compairconfig['SQLALCHEMY_DATABASE_URI']) - ##config['SQLALCHEMY_DATABASE_URI'] - ##print("XXXXXXXXXX SQLALCHEMY_DATABASE_URI:" + str(current_app.config['SQLALCHEMY_DATABASE_URI'])) - - ##db_url = "mysql+pymysql://compair:compair@db:3306/compair?charset=utf8mb4" db_url = str(current_app.config['SQLALCHEMY_DATABASE_URI']) engine = create_engine(db_url, pool_size=5, pool_recycle=3600) conn = engine.connect() ##sql_text = str("SELECT JSON_OBJECT('uuid', uuid,'name', name,'compare_start', compare_start, 'compare_end', compare_end) FROM assignment;"); - sql_text = str("SELECT JSON_OBJECT('uuid', uuid,'name', name,'compare_start', compare_start, 'compare_end', compare_end) FROM assignment WHERE compare_end >= '" + end_date + "';"); + ##sql_text = str("SELECT JSON_OBJECT('uuid', uuid,'name', name,'compare_start', compare_start, 'compare_end', compare_end) FROM assignment WHERE compare_end >= '" + end_date + "';"); + sql_text = str("SELECT JSON_OBJECT('uuid', uuid,'name', name,'answer_start', answer_start,'answer_end', answer_end,'compare_start', compare_start, 'compare_end', compare_end) FROM assignment WHERE compare_end >= '" + end_date + "' OR answer_end >= '" + end_date + "';"); print(sql_text) @@ -85,10 +71,7 @@ def get(self): final_result = [list(i) for i in result] conn.close() - ##print("XXXXXXXXXX:" + str(final_result)) return jsonify(final_result) - ##return jsonify({'status': 'OK'}) - api.add_resource(AssignmentRootAPI1, '') diff --git a/compair/static/compair-config.js b/compair/static/compair-config.js index 74cae2ede..915d13b1c 100644 --- a/compair/static/compair-config.js +++ b/compair/static/compair-config.js @@ -475,7 +475,7 @@ myApp.config( { title: 'Assignment EndDate', templateUrl: 'modules/assignment/assignment-search-partial.html', - label: "Assignment Search", + label: "Assignment EndDate", controller: 'AssignmentSearchEndDateController', resolve: { resolvedData: function() { diff --git a/compair/static/modules/assignment/assignment-search-partial.html b/compair/static/modules/assignment/assignment-search-partial.html index 95ba53eb6..c8ce5a5ee 100644 --- a/compair/static/modules/assignment/assignment-search-partial.html +++ b/compair/static/modules/assignment/assignment-search-partial.html @@ -3,8 +3,8 @@