support for handling additional, non-descript, attribute properties t…#15
Open
actongorton wants to merge 1 commit intoescaped:masterfrom
Open
support for handling additional, non-descript, attribute properties t…#15actongorton wants to merge 1 commit intoescaped:masterfrom
actongorton wants to merge 1 commit intoescaped:masterfrom
Conversation
Owner
|
HI @actongorton, thanks for your contribution. I think this could be a nice addition for some special use case. But I would prefer if the method returns a dictionary of attributes instead of a single string. This ensures, that the final rendered attributes are always in the correct format and errors like missing What do you think about that? If you like the idea, could you please update your PR and add some test cases that ensure the final HTML-tag is rendered correctly? Thanks :) |
Author
|
Yes, good idea. Let me take another pass at it.
… On Dec 30, 2018, at 6:20 AM, Alexander Frenzel ***@***.***> wrote:
HI @actongorton,
thanks for your contribution. I think this could be a nice addition for some special use case. But I would prefer if the method returns a dictionary of attributes instead of a single string. This ensures, that the final rendered attributes are always in the correct format and errors like missing " are prevented.
def get_validate_ercd_attrs(self, obj):
return {
'target': '_blank',
}
What do you think about that? If you like the idea, could you please update your PR and add some test cases that ensure the final HTML-tag is rendered correctly?
Thanks :)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
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.
…o the buttons
I needed a way to have actions take place in a new browser window, but since I may want to have other attributes in the future, seemed to me that being able to add generic attribute tags could be useful for other things.
For example, if my action is named
validate_ercd, then I can now add an attribute like so:This causes the record to be opened in a new browser window instead of the current browser window.