„model.py“ ändern
This commit is contained in:
parent
d5da356345
commit
53407feb35
13
model.py
13
model.py
@ -248,6 +248,19 @@ class CaseBase:
|
||||
)
|
||||
|
||||
def get_values_by_field(self, field: str) -> set[str]:
|
||||
"""
|
||||
get the distinct values by the fields
|
||||
|
||||
Args:
|
||||
self: List with corresponding values
|
||||
field: a string value that must be contained in self
|
||||
|
||||
Returns:
|
||||
the distinct values
|
||||
|
||||
Raises:
|
||||
ValueError: if the field value not in the 'problem' or 'solution' list
|
||||
"""
|
||||
|
||||
if field not in list(self.fields["problem"]) + list(self.fields["solution"]):
|
||||
raise ValueError(f"unknown field {field}")
|
||||
|
Loading…
Reference in New Issue
Block a user