(self)
| 816 | @computed_field |
| 817 | @property |
| 818 | def id(self) -> str: |
| 819 | str_obj = self.model_dump_json(exclude={'id'}) |
| 820 | # you could imagine hashing str_obj, etc. but for simplicity, just wrap it in a descriptive string |
| 821 | return f'id: {str_obj}' |
| 822 | |
| 823 | m = Model(bar=42) |
| 824 | assert m.model_dump() == {'bar': 42, 'id': 'id: {"bar":42}'} |
nothing calls this directly
no test coverage detected