response.layout (new feature just for scaffold app)?

60 views
Skip to first unread message

Mirek Zvolsky

unread,
Dec 9, 2016, 10:36:38 AM12/9/16
to web2py-d...@googlegroups.com
What do you think about this?
I made PR, but I don't know if this is good idea or completly bad one.

https://github.com/web2py/web2py/pull/1544

Of course, it must be used with additional settings inside model used in custom view,
like
<button class = "{{=response.css.mainbutton}}"></button>
where
response.css.mainbutton = 'btn red'                # for stupid
response.css.mainbutton = 'w3-btn w3-red'    # for w3


Regardless of your decision I want find some method how to experiment with different css frameworks (bootstrap vs stupid vs w3 vs ?),
this could help me a little.
But maybe it exists much better solution.

Because it is just in scaffolding app, I will have no problem if you decide reject this, because everybody can implement this yourself.
I mean just it would be nice to find some standard way how to do things.

Anthony

unread,
Dec 9, 2016, 2:51:08 PM12/9/16
to web2py-developers
On Friday, December 9, 2016 at 10:36:38 AM UTC-5, Mirek Zvolsky wrote:
What do you think about this?
I made PR, but I don't know if this is good idea or completly bad one.

https://github.com/web2py/web2py/pull/1544

Just to further clarify Massimo's comment from Github, if you have:

{{extend response.layout}}

the view cannot be compiled because the value of response.layout will not be known at compile time (only at run time). I don't think we want this pattern to be the default in the scaffolding app (though it may be appropriate in special cases).

Anthony

Mirek Zvolsky

unread,
Dec 12, 2016, 7:02:01 AM12/12/16
to web2py-developers
Yes, thanks.
Please reject the PR.
Reply all
Reply to author
Forward
0 new messages