Skip to content
This repository was archived by the owner on Apr 15, 2025. It is now read-only.
Draft
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
5 changes: 4 additions & 1 deletion src/prisma/generator/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
# set of templates that should be rendered after every other template
DEFERRED_TEMPLATES = {'partials.py.jinja'}

# template files that shouldn't actually result in an output file
IGNORE_TEMPLATES = {'_utils.py.jinja', '_header.py.jinja', '_pragma.py.jinja'}

DEFAULT_ENV = Environment(
trim_blocks=True,
lstrip_blocks=True,
Expand Down Expand Up @@ -244,7 +247,7 @@ def generate(self, data: PythonData) -> None:

try:
for name in DEFAULT_ENV.list_templates():
if not name.endswith('.py.jinja') or name.startswith('_') or name in DEFERRED_TEMPLATES:
if not name.endswith('.py.jinja') or name in IGNORE_TEMPLATES or name in DEFERRED_TEMPLATES:
continue

render_template(rootdir, name, params)
Expand Down