Add support for dynamic setting of attributes from context based on #151#152
Open
maximbelyayev wants to merge 3 commits intojazzband:masterfrom
Open
Add support for dynamic setting of attributes from context based on #151#152maximbelyayev wants to merge 3 commits intojazzband:masterfrom
maximbelyayev wants to merge 3 commits intojazzband:masterfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for dynamically setting widget attributes from the rendering context based on #151.
- Introduces a mechanism to merge a dynamically resolved dictionary into the attributes via the special key "attr_dict".
- Refactors the handling of boolean and "type" attribute values during rendering.
Files not reviewed (1)
- README.rst: Language not supported
| if v: | ||
| if isinstance(v, bool): | ||
| bounded_field = set_attr(bounded_field, f"{k}") | ||
| if k == "type": |
There was a problem hiding this comment.
The current conditional structure may result in duplicate attribute assignments for non-'type' keys with boolean values. Consider restructuring the conditionals using if-elif-else to ensure that each attribute is processed only once.
Suggested change
| if k == "type": | |
| elif k == "type": |
aleksihakli
reviewed
Apr 25, 2025
|
|
||
| .. code-block:: html+django | ||
|
|
||
| context_dict_var = {"type":"text", id="my_username_id", placeholder="Login"} |
Member
There was a problem hiding this comment.
Is this correct? If this is a Python dict then shouldn't it be:
Suggested change
| context_dict_var = {"type":"text", id="my_username_id", placeholder="Login"} | |
| context_dict_var = {"type":"text", "id": "my_username_id", "placeholder: "Login"} |
Member
|
@maximbelyayev sorry for the delay in the review, would you happen to have the opportunity to look into the review notes? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.