Skip to content

Commit

Permalink
IVS-63 ValidationOutcome to dict in DEV
Browse files Browse the repository at this point in the history
  • Loading branch information
Ghesselink authored Sep 9, 2024
1 parent 10e5a2a commit bc5ca00
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1107,6 +1107,19 @@ def __str__(self):
'Observed': self.observed
}
return f' '.join(f'{k}={v}' for k, v in members.items() if v)

def to_dict(self):
return {
"id": self.id,
"instance_id": self.instance_public_id,
"validation_task_id": self.validation_task_public_id,
"feature": self.feature,
"feature_version": self.feature_version,
"severity": self.get_severity_display(), # Convert the integer to a human-readable string
"outcome_code": self.outcome_code,
"expected": self.expected,
"observed": self.observed,
}

@property
def instance_public_id(self):
Expand Down

0 comments on commit bc5ca00

Please sign in to comment.