Skip to content
This repository was archived by the owner on Apr 15, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/prisma/generator/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,8 @@ class Config(BaseSettings):
# https://github.com/prisma/prisma/issues/12442
enable_experimental_decimal: bool = FieldInfo(default=False, env='PRISMA_PY_CONFIG_ENABLE_EXPERIMENTAL_DECIMAL')

pydantic_disable_protected_namespaces: bool = False

# this seems to be the only good method for setting the contextvar as
# we don't control the actual construction of the object like we do for
# the Data model.
Expand Down
3 changes: 3 additions & 0 deletions src/prisma/generator/templates/bases.py.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ class _PrismaModel(BaseModel):
use_enum_values=True,
arbitrary_types_allowed=True,
populate_by_name=True,
{% if generator.config.pydantic_disable_protected_namespaces %}
protected_namespaces=(),
{% endif %}
)
elif not TYPE_CHECKING:
from ._compat import BaseConfig
Expand Down