A job has many tasks. This object is now referred as Task Template in the UI, we still need to change variable name and table names but for now think about using Job/TaskTemplate interchangeably inside the code and try to refactor naming whenever possible. *** add stuff t
| 19 | |
| 20 | |
| 21 | class Job(Base, Caching): |
| 22 | """ |
| 23 | A job has many tasks. |
| 24 | |
| 25 | This object is now referred as Task Template in the UI, we still need to change variable name and table names |
| 26 | but for now think about using Job/TaskTemplate interchangeably inside the code and try to refactor naming |
| 27 | whenever possible. |
| 28 | |
| 29 | *** |
| 30 | |
| 31 | add stuff to copy_job_for_exam() if adding things! |
| 32 | |
| 33 | *** |
| 34 | |
| 35 | """ |
| 36 | |
| 37 | __tablename__ = 'job' |
| 38 | id = Column(Integer, primary_key = True) |
| 39 | hidden = Column(Boolean, default = False) # hidden or deleted... |
| 40 | |
| 41 | is_live = Column(Boolean, default = True) |
| 42 | |
| 43 | attached_directories_dict = Column(MutableDict.as_mutable(JSONEncodedDict), |
| 44 | default = {'attached_directories_list': []}) |
| 45 | |
| 46 | security_require_email_verified = Column(Boolean, default = True) |
| 47 | |
| 48 | status = Column(String(), default = "draft") |
| 49 | # created (or draft?), active, in_review, reported, removed |
| 50 | # save_for_later, complete, failed |
| 51 | # in_progress vs "available" depends on point of reference |
| 52 | |
| 53 | type = Column(String(), default = 'Normal') # ['Normal', 'Exam', 'Learning'] |
| 54 | |
| 55 | is_template = Column(Boolean, default = False) |
| 56 | # While we could intuit this from the exam id prefer explicit |
| 57 | # If it's not a template then we assume it's an Instance of the Exam |
| 58 | # (or could apply to other template / instance things in future.) |
| 59 | |
| 60 | is_pinned = Column(Boolean(), default = False) |
| 61 | |
| 62 | instance_type = Column(String) |
| 63 | # ['polygon', 'box', 'tag', 'text_tokens'] |
| 64 | |
| 65 | pro_network = Column(Boolean, |
| 66 | default = False) # Prior had "market" as a share type but a single bool here is more clear. |
| 67 | |
| 68 | default_userscript_id = Column(Integer, ForeignKey('userscript.id')) |
| 69 | default_userscript = relationship("UserScript", foreign_keys = [default_userscript_id]) |
| 70 | |
| 71 | share_type = Column(String()) # ['Market', 'project', 'org'] |
| 72 | permission = Column(String()) # ['invite_only', 'Only me', 'all_secure_users'] |
| 73 | |
| 74 | project_id = Column(Integer, ForeignKey('project.id')) |
| 75 | project = relationship("Project") |
| 76 | |
| 77 | category = Column(String(), default = 'visual') |
| 78 |
no outgoing calls
no test coverage detected