πŸ’­ Fields - Pydantic ━━━━━━━━━━━━━━━━━━━ !https://docs.pydantic.dev/2.7/concepts/fields/#field-representation Date: May 9, 2024 Image: Fields Fields Pydantic Docs Β· docs.pydantic.dev exclude=True and repr=False is a good pydantic combination for secret attributes such as user passwords, or hashed passwords. exclude keeps it out of model_dumps, and repr keeps it out of the logs. [code] from pydantic import BaseModel, Field class User(BaseModel): name: str = Field(repr=True) age: int = Field(repr=False) user = User(name='John', age=42) print(user) #> name='John' NOTE β”‚ This post is a thought </thoughts/>. It’s a short note that I make about someone else’s content online #thoughts </tags/thoughts/>