| 28 | |
| 29 | |
| 30 | class Event(Base): |
| 31 | __tablename__ = 'event' |
| 32 | |
| 33 | """ |
| 34 | |
| 35 | Stuff that happens in the system |
| 36 | ie |
| 37 | New project |
| 38 | |
| 39 | kind = new_project |
| 40 | member_id = "person / api key who created it" |
| 41 | |
| 42 | link = [url to new project, for user facing activity?] |
| 43 | |
| 44 | description = "optional string information on the event?" |
| 45 | |
| 46 | """ |
| 47 | |
| 48 | id = Column(BIGINT, primary_key = True) |
| 49 | |
| 50 | kind = Column(String()) |
| 51 | |
| 52 | page_name = Column(String()) |
| 53 | |
| 54 | object_type = Column(String()) |
| 55 | |
| 56 | description = Column(String()) |
| 57 | |
| 58 | success = Column(Boolean) |
| 59 | |
| 60 | error_log = Column(MutableDict.as_mutable(JSONEncodedDict)) |
| 61 | # Would prefer to store full error log like mutable dict? |
| 62 | |
| 63 | run_time = Column(Float) # In milliseconds ie using time.time() |
| 64 | # Not required, but relevant for long running operations, ie export_generation |
| 65 | # also something we could potentially turn on on demand if |
| 66 | # an issue is detected around an event |
| 67 | |
| 68 | link = Column(String()) # Context of being able to go to event |
| 69 | # This could easily become out of date, but at least it's a starting point |
| 70 | |
| 71 | project_id = Column(Integer, ForeignKey('project.id')) |
| 72 | project = relationship("Project") |
| 73 | |
| 74 | input_id = Column(Integer, ForeignKey('input.id')) |
| 75 | input = relationship("Input") |
| 76 | |
| 77 | task_id = Column(Integer, ForeignKey('task.id')) |
| 78 | task = relationship("Task") |
| 79 | |
| 80 | job_id = Column(Integer, ForeignKey('job.id')) |
| 81 | job = relationship("Job") |
| 82 | |
| 83 | member_id = Column(Integer, ForeignKey('member.id')) |
| 84 | member = relationship('Member', foreign_keys = [member_id]) |
| 85 | |
| 86 | file_id = Column(Integer, ForeignKey('file.id')) |
| 87 | file = relationship("File") |
no outgoing calls
no test coverage detected