MCPcopy
hub / github.com/diffgram/diffgram / list

Method list

shared/database/task/task.py:626–734  ·  view source on GitHub ↗
(session,
             task_ids = None,
             status = None,
             date_from = None,
             date_to = None,
             job_id = None,
             job_id_list = None,
             incoming_directory_id = None,
             file_id = None,
             project_id = None,
             mode_data = None,
             issues_filter = None,
             return_mode = None,
             limit_count = 25,
             page_number = 0  # 0 is same as no offset
             )

Source from the content-addressed store, hash-verified

624
625 @staticmethod
626 def list(session,
627 task_ids = None,
628 status = None,
629 date_from = None,
630 date_to = None,
631 job_id = None,
632 job_id_list = None,
633 incoming_directory_id = None,
634 file_id = None,
635 project_id = None,
636 mode_data = None,
637 issues_filter = None,
638 return_mode = None,
639 limit_count = 25,
640 page_number = 0 # 0 is same as no offset
641 ):
642 query = session.query(Task)
643 if task_ids:
644 query = query.filter(
645 Task.id.in_(task_ids)
646 )
647 if status and status != 'all':
648 query = query.filter(
649 Task.status == status
650 )
651 elif status == 'all':
652 query = query.filter(
653 Task.status != 'archived'
654 )
655 else:
656 query = query.filter(
657 Task.status != 'archived'
658 )
659 if incoming_directory_id:
660 query = query.filter(Task.incoming_directory_id == incoming_directory_id)
661
662 if job_id_list:
663 query = query.filter(Task.job_id.in_(job_id_list))
664
665 if job_id:
666 query = query.filter(Task.job_id == job_id)
667
668 if mode_data == "exam_results":
669 # Only show review tasks since this is what would count here?
670 # QUESTION do we want to have the job type check here too
671 # query = query.filter(Task.task_type == "review", Task.job_type == "Exam")
672
673 # WIP with auto grader, reviews may just be posted on original tasks.
674 query = query.filter(Task.job_type == "Exam")
675
676 if date_from:
677 date_from = datetime.datetime.strptime(date_from, "%Y-%m-%d")
678 query = query.filter(Task.time_updated >= date_from)
679 if date_to:
680 date_to = datetime.datetime.strptime(date_to, "%Y-%m-%d")
681 query = query.filter(Task.time_updated <= date_to)
682
683 if file_id:

Callers 15

test_listMethod · 0.45
test_listMethod · 0.45
test_listMethod · 0.45
test_listMethod · 0.45
test_listMethod · 0.45
test_listMethod · 0.45
test_listMethod · 0.45
test_listMethod · 0.45
test_serializeMethod · 0.45
project_list_coreFunction · 0.45

Calls 1

countMethod · 0.45

Tested by 9

test_listMethod · 0.36
test_listMethod · 0.36
test_listMethod · 0.36
test_listMethod · 0.36
test_listMethod · 0.36
test_listMethod · 0.36
test_listMethod · 0.36
test_listMethod · 0.36
test_serializeMethod · 0.36