(self, key, val)
| 294 | |
| 295 | @validates("ID", "name", "ownerID") |
| 296 | def validator(self, key, val): |
| 297 | map = { |
| 298 | "ID" : lambda _val: isinstance(_val, int), |
| 299 | "name" : lambda _val: True, |
| 300 | "ownerID": lambda _val: isinstance(_val, int) or _val is None |
| 301 | } |
| 302 | |
| 303 | if not map[key](val): |
| 304 | raise ValueError(str(val) + " is not a valid value for " + key) |
| 305 | else: |
| 306 | return val |
| 307 | |
| 308 | def __repr__(self): |
| 309 | return "Character(ID={}, name={}) at {}".format( |
nothing calls this directly
no outgoing calls
no test coverage detected