Skip to content

Conversation

@bluerosej
Copy link
Contributor

  1. Created Jinja template for index.html
  2. Set up main.py to render index.html w/ Jinja
  3. Modified JinjaRenderer to not convert values to strings if list or dict in JinjaRenderer.py

pydanny added a commit to feldroy/air that referenced this pull request Oct 12, 2025
@bluerosej discovered that Air's Jinja rendering system is stringifying everything. She also provided a fix in pyladiesmanila/VoicesOfPyLadiesManila#18. We expand on that excellent fix by constraining it to just stringify BaseTag-inherited items so that Jinja can operate normally.

Co-Authored-By: Rose J <[email protected]>
Copy link

@pydanny pydanny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bluerosej I essentially copied your fix basically right into core Air in this PR. The change I made was to constrain context to just stringify Air Tags and add formal tests, but otherwise it is identical.

For that reason I shared co-author credits on the commit. And am sharing credit for the PR with you.

If you ever want to contribute directly to Air, I'm happy to assist you in any ticket that interests you. 😄

I also invite you to the Air Discord, where me, @audreyfeldroy, and others chat about Air. (It is easier to discuss tickets there than in PR comments)

Comment on lines +85 to +87
context = {
k: v if isinstance(v, (list, dict)) else str(v) for k, v in context.items()
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicely done! 💪🏻

@@ -0,0 +1,91 @@
# Import libraries for JinjaRenderer
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Traditionally in Python files are named in snake_case rather than PascalCase. This follows the PEP8 standard.

from air.requests import Request


# Copied from: https://github.com/feldroy/air/blob/main/src/air/templating.py
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I appreciate the attribution to core Air. Not everyone does that. 🙏🏻

@bluerosej
Copy link
Contributor Author

@bluerosej I essentially copied your fix basically right into core Air in this PR. The change I made was to constrain context to just stringify Air Tags and add formal tests, but otherwise it is identical.

For that reason I shared co-author credits on the commit. And am sharing credit for the PR with you.

If you ever want to contribute directly to Air, I'm happy to assist you in any ticket that interests you. 😄

I also invite you to the Air Discord, where me, @audreyfeldroy, and others chat about Air. (It is easier to discuss tickets there than in PR comments)

Hi @pydanny, thanks for fixing the bug and for sharing credit! Okay, I will explore Air some more and see if there are any open issues I can work on later on. Thanks for the invite! 😄

pydanny added a commit to feldroy/air that referenced this pull request Oct 14, 2025
@bluerosej discovered that Air's Jinja rendering system is stringifying everything. She also provided a fix in pyladiesmanila/VoicesOfPyLadiesManila#18. We expand on that excellent fix by constraining it to just stringify BaseTag-inherited items so that Jinja can operate normally.

Co-Authored-By: Rose J <[email protected]>
pydanny added a commit to feldroy/air that referenced this pull request Oct 15, 2025
@bluerosej discovered that Air's Jinja rendering system is stringifying everything. She also provided a fix in pyladiesmanila/VoicesOfPyLadiesManila#18. We expand on that excellent fix by constraining it to just stringify BaseTag-inherited items so that Jinja can operate normally.

Co-Authored-By: Rose J <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants