Skip to content

Commit

Permalink
fix: Use of stdlib dataclasses with BaseModel doc bug
Browse files Browse the repository at this point in the history
  • Loading branch information
patelnets committed Jan 4, 2024
1 parent c067c1b commit b8b883c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/concepts/dataclasses.md
Expand Up @@ -250,7 +250,7 @@ import dataclasses
from datetime import datetime
from typing import Optional

from pydantic import BaseModel, ValidationError
from pydantic import BaseModel, ConfigDict, ValidationError


@dataclasses.dataclass(frozen=True)
Expand All @@ -265,6 +265,8 @@ class File:


class Foo(BaseModel):
model_config = ConfigDict(revalidate_instances='always')
# Required so that pydantic revalidates the model attributes
file: File
user: Optional[User] = None

Expand Down

0 comments on commit b8b883c

Please sign in to comment.