(self, criteria)
| 12 | self._created = self.get_current_timestamp() |
| 13 | |
| 14 | def match(self, criteria): |
| 15 | if not criteria: |
| 16 | return self |
| 17 | criteria_matches = [] |
| 18 | for k, v in criteria.items(): |
| 19 | if type(v) is tuple: |
| 20 | for val in v: |
| 21 | if getattr(self, k) == val: |
| 22 | criteria_matches.append(True) |
| 23 | else: |
| 24 | if getattr(self, k) == v: |
| 25 | criteria_matches.append(True) |
| 26 | if len(criteria_matches) >= len(criteria) and all(criteria_matches): |
| 27 | return self |
| 28 | |
| 29 | def update(self, field, value): |
| 30 | """ |
no outgoing calls
no test coverage detected