sqlalchemy / sqlalchemy/mako

[feature] List all filenames used in render()

Open
#300 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature runtime
Dominant language
Python
Stars
459
Forks
90
PR merge metrics
No merged PRs in 30d

Description

I've got a fairly complex template layout. It would be helpful for debugging to have a way I could see which filenames are part of a template.

Example:
example.tmpl includes two template files : included_filename1.tmpl included_filename2.tmpl

lookup = mako.lookup.TemplateLookup(directories='/my/directory')
template = lookup.get_template('example.tmpl')

If the template object supported something like source_files that provided ['example.tmpl', 'included_filename1.tmpl', 'included_filename2.tmpl'] that would dramatically simplify my debugging down the line.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the TemplateLookup.get_template entry point and the render/include flow described in the issue. Trace how the root template and included filenames are resolved, then define how the source_files result should represent that set. Done means a template can expose example.tmpl and both included filenames for the given example.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.