ecourts.entities.act_type
1from entities.court import Court 2from dataclasses import dataclass 3import json 4 5 6@dataclass 7class ActType: 8 code: int 9 """The code of the act type.""" 10 11 description: str 12 """The description of the act type.""" 13 14 court: Court 15 """The court associated with the act type.""" 16 17 def keys(self): 18 return ["code", "description", "court_state_code", "court_court_code"] 19 20 def __getitem__(self, key): 21 if key in ["code", "description"]: 22 return getattr(self, key) 23 elif key == "court_state_code": 24 return self.court.state_code 25 elif key == "court_court_code": 26 return self.court.court_code 27 else: 28 raise KeyError(key)
@dataclass
class
ActType:
7@dataclass 8class ActType: 9 code: int 10 """The code of the act type.""" 11 12 description: str 13 """The description of the act type.""" 14 15 court: Court 16 """The court associated with the act type.""" 17 18 def keys(self): 19 return ["code", "description", "court_state_code", "court_court_code"] 20 21 def __getitem__(self, key): 22 if key in ["code", "description"]: 23 return getattr(self, key) 24 elif key == "court_state_code": 25 return self.court.state_code 26 elif key == "court_court_code": 27 return self.court.court_code 28 else: 29 raise KeyError(key)