Re: Anybody available to test patches for jinja2 template?
"John P. Rouillard" <[email protected]>
| Newsgroups | gmane.comp.bug-tracking.roundup.user |
|---|---|
| Message-ID | <[email protected]> |
Hi Christof, Did you ever respond to my thoughts on the need for html_kwargs vs **kwargs? If so I never saw it and this patch is stalled as a result. I would like to get the results of your work applied into the next pre-2.0.0 release. Thoughts? thx. -- rouilj In message <[email protected]>, "John P. Rouillard" writes: >Hi Christof: > >Thanks for taking the time to work on this. > >In message <[email protected]>, >Christof Meerwald writes: >>On Mon, 20 May 2019 19:19:57 -0400, John P. Rouillard wrote: >>> I would like to get these patches in place as they upgrade to >>> bootstrap4 and do some other additions. >> >>I guess the main question for the other additions is if adding a >>"html_kwargs={}" parameter to the "submit" methods is the right thing >>to do - or if it would be better adding that as "**kwargs" parameter. >> >>"classhelp" and "menu" currently have "html_kwargs" parameters, but >>"renderWith", "field", "multiline" have "**kwargs" parameters. I think >>my preference would be to have "**kwargs" parameter as "submit" seems >>pretty similar to "multiline" as it maps fairly directly to an HTML >>"input" tag (similar to "multiline"). > >I think I expanded the use of html_kwargs in the core with some of my >patches. I think I may have tried passing class as an argument to and >I think I had issues doing: > > some_python_func(arg1, arg2, namedarg1=a, class="collapsible") > >at some point. So I added: > > some_python_func(arg1, arg2, namedarg1=a, > html_kwargs={"class": "collapsible"}) > >(well you get the idea). The only thing that concerns me is that a >**kwargs may conflict with a named parameter in a future release of >roundup. Also if this code used only in core roundup, I would be less >concerned but code like: > > <span tal:condition="not:InBatchUpdate" > tal:content="structure > python:context.keyword.menu(size=30, > html_kwargs={'id': > 'keyword', 'data-placeholder' : 'Select Topics', > 'class': 'multiselect' }) or > default" > >None</span> > >can be put in a tracker template. Because of that I think it is >safer/more future proof to use html_kwargs rather than **kwargs. (I >think **kwargs looks cleaner than the dict passed to html_kwargs >but...) > >Does my concern/explanation make sense? > >Also does this concern mean that we should also be supporting >html_kwargs where we currently support **kwargs? If we do we would >support backward compatibility for **kwargs if html_kwargs is not set. > >>BTW, I have cleaned up whitespace changes and indentation for the >>template changes at >>https://bitbucket.org/cmeerw/roundup/commits/8b0f049af488becd1f18ff70dab23b9f23dd2557?at=jinja2-bootstrap > >That looks much cleaner than what I was seeing. > >Nice job. -- -- rouilj John Rouillard =========================================================================== My employers don't acknowledge my existence much less my opinions.