+ def get_all_str(self, key: str) -> list[str]:
+ """Retrieve list of string values at key from self.postvars."""
+ if key not in self.postvars:
+ return []
+ return self.postvars[key]
+
+ def get_all_int(self, key: str) -> list[int]:
+ """Retrieve list of int values at key from self.postvars."""
+ all_str = self.get_all_str(key)
+ try:
+ return [int(s) for s in all_str if len(s) > 0]
+ except ValueError as e:
+ msg = f'cannot int a form field value: {all_str}'
+ raise BadFormatException(msg) from e
+