Bootstrap is really killing web2py

5,162 views
Skip to first unread message

Moustafa Mahmoud

unread,
Jul 18, 2014, 3:17:34 PM7/18/14
to web...@googlegroups.com
I have been using web2py for 3 years know, and I was really impressed by it, I defended it in every discussion, even implemented all my projects using it and even convinced my Graduation Project Team to use it in our GP. However, as my skill increased and I began looking more into customizing my applications, I have hit a brick wall discovering how tightly bound web2py is to bootstrap2, I wanted to use bootstrap 3 but was faced with tons of problems. If I want to move to another front end framework then I discovered that it would be easier to use another framework because of the time and effort I would need to invest in modifying all parts of web2py that are tightly bound  to bootstrap.
This will result in making web2py a headache to me rather than my best friend. I am writing this message because I am really sad that an amazing framework like web2py is forcing me to consider an alternative because I do really feel it is constraining me at this point.
Any help or ideas about that ?

Massimo Di Pierro

unread,
Jul 20, 2014, 11:23:11 AM7/20/14
to web...@googlegroups.com
I agree. this is a priority. Mind that since git revision  ae0749d6b8b9d0bf111c395674f629f3a1e48cfc we had boostrap 3 support. We reverted it because people were not happy with the implementation.

The issue here is should support only bs2 and bs3 in grid or should we support arbitrary css via a plugin system for the grid. 

Massimo

Anthony

unread,
Jul 20, 2014, 11:31:03 AM7/20/14
to web...@googlegroups.com
Can you give examples of things that work only with Bootstrap 2?

Massimo Di Pierro

unread,
Jul 21, 2014, 4:39:56 AM7/21/14
to web...@googlegroups.com
Here is welcome optimized for bootstrap 3. It still needs to have forms and grid formstyle be set to formstyle_bootstrap3. 
web2py.app.welcome3.w2p

Gael Princivalle

unread,
Jul 23, 2014, 2:57:59 AM7/23/14
to web...@googlegroups.com
Hello Moustafa.

I agree with you and hope that we'll have soon a fully Bootstrap 3 web2py version.

Massimo Di Pierro

unread,
Jul 23, 2014, 3:53:17 AM7/23/14
to web...@googlegroups.com
we should have a new web2py version by mid August, including bs3.

Vinicius Assef

unread,
Jul 23, 2014, 7:25:46 AM7/23/14
to web2py
On Wed, Jul 23, 2014 at 4:53 AM, Massimo Di Pierro
<massimo....@gmail.com> wrote:
> we should have a new web2py version by mid August, including bs3.

Adding BS3 or replacing BS2 with BS3?

Anthony

unread,
Jul 23, 2014, 9:45:17 AM7/23/14
to web...@googlegroups.com
Maybe I'm missing something, but I'm still not sure how Bootstrap 2 is "killing" web2py. I think the only thing that defaults to Bootstrap 2 styling is the grid, but it now also includes Bootstrap 3 classes. However, it also includes a jQuery-UI theme and can be customized for other CSS frameworks via the "ui" argument (or via CSS using the existing classes). Standard forms don't default to Bootstrap at all and can be customized as desired via the formstyle argument. There is a bug applying formstyles to the verify password field in Auth register forms, but that is not Bootstrap specific (and there is a workaround).

It's also not clear how switching to a different framework would help. Other frameworks probably won't have built-in grids and Auth forms, so you would have to handle those things manually or via third party libraries anyway, which you can already do just as easily in web2py.

I think it would be helpful to see examples of "brick walls" and how they would be handled more easily in another framework.

Anthony

Vinicius Assef

unread,
Jul 23, 2014, 2:43:36 PM7/23/14
to web2py
+1
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+un...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

sasogeek

unread,
Jul 26, 2014, 6:41:24 PM7/26/14
to web...@googlegroups.com
So... I'm not really sure what this whole conversation is about, as to whether it's an issue of web2py coming with bs2 by default or some difficulty in implementing bs3. I use bs3 just fine in my web2py apps and really haven't had any issues..

lyn2py

unread,
Jul 27, 2014, 9:46:54 AM7/27/14
to web...@googlegroups.com
+1

Moustafa Mahmoud

unread,
Jul 27, 2014, 7:31:16 PM7/27/14
to web...@googlegroups.com
That would be really Great, Also It will be a great Idea to have Web2py Power decoupled from any Front End Framework, even as a separate project .

Anthony

unread,
Jul 28, 2014, 8:00:44 AM7/28/14
to web...@googlegroups.com
On Sunday, July 27, 2014 7:31:16 PM UTC-4, Moustafa Mahmoud wrote:
That would be really Great, Also It will be a great Idea to have Web2py Power decoupled from any Front End Framework, even as a separate project .

Can you explain more what you are looking for? web2py is not coupled to any front end framework. Are you specifically referring to the scaffolding application? You are not required to use any of the CSS or layout from the scaffolding application -- you can create your own using any framework, or no framework at all. The only thing you really need from the scaffolding app is web2py.js (and even that is not a hard requirement).

Anthony

Stodge

unread,
Jul 29, 2014, 7:36:27 AM7/29/14
to web...@googlegroups.com
My guess is that web2py includes BS2.
Message has been deleted

Massimo Di Pierro

unread,
Jul 29, 2014, 11:36:06 AM7/29/14
to web...@googlegroups.com
web2py includes bs2 but this is client side and it is trivial to replace it with bs3. I do it all the times. The problem is that it takes some JS to style the grid.

Massimo

Dragan Matic

unread,
Jul 29, 2014, 12:16:13 PM7/29/14
to web...@googlegroups.com
Is there some tutorial how to do it for those of us not so versed in CSS? If you just replace bootstrap.min.css in static/css the menus and forms do not work the way they used to in BS2.

Anthony

unread,
Jul 29, 2014, 7:12:44 PM7/29/14
to web...@googlegroups.com
On Tuesday, July 29, 2014 12:16:13 PM UTC-4, Dragan Matic wrote:
Is there some tutorial how to do it for those of us not so versed in CSS? If you just replace bootstrap.min.css in static/css the menus and forms do not work the way they used to in BS2.

Note, in general, you should not expect to simply replace the CSS for one framework with that of another and have it work. The reason is that front-end frameworks require a combination of CSS and specific HTML structure with framework-specific classes. So, the layout must be customized for the framework.

The layout and CSS of the web2py scaffolding app is just intended as a basic template. It is not part of the web2py framework nor coupled to the framework. It is just one layout that you can use if you want. If you want to use a different front end framework or some other template, you should mostly throw out the scaffolding app layout and instead start with an external template. You can then modify your template to turn it into a layout.html view file (look at the scaffolding layout.html for ideas of how to set it up). Check out http://web2py.com/books/default/chapter/29/05/the-views#Page-layout for more details.

Anthony

Gael Princivalle

unread,
Jul 30, 2014, 5:05:13 AM7/30/14
to
Hi Anthony.

I think that web2py grids are really powerful and useful. If web2py grids are not fully compatible with BS3 for me it's a problem. As websites must be generally designed now first for mobile devices, I think that web2py front end as to be done with BS3, and has to be responsive.

Dragan Matic

unread,
Jul 30, 2014, 7:21:43 AM7/30/14
to web...@googlegroups.com
Anthony,

Thanks for the answer, I was aware of that completely. It is just that Massimo said that it is trivial to replace BS2 with BS3 yet when I try to do it the trivial way and then create a FORM in controller (whether it be simple form, sqlform or sqlform.factory) the form looks completely wrong. The same is with main menu.

Now I know that in this case I should create form in HTML using appropriate BS3 classes and then use that form in controller but I think you will agree that this takes away the ease of use which is one of the main strengths of web2py.

I suppose that was why OP named this thread "Bootstrap is killing web2py". I think a lot of web2py users (like myself) are novices in web programming and while it may be trivial for versed web programmer to use BS3 with web2py it is not the case for the beginners. BS3 is more than a year old but I still develop my web apps using BS2 because that is what ships with web2py. I don't want to criticize, web2py is an excellent framework but I think it needs to ship with BS3, otherwise it will lose a lot of novice programmers and I think novice programmers are important because those are the future user base of web2py.

Just my 2c.

Anthony

unread,
Jul 30, 2014, 11:39:36 AM7/30/14
to web...@googlegroups.com
On Wednesday, July 30, 2014 5:05:13 AM UTC-4, Gael Princivalle wrote:
Hi Anthony.

I think that web2py grids are really powerful and useful. If web2py grids are not fully compatible with BS3 for me it's a problem. As websites must be generally designed now first for mobile devices, I think that web2py front end as to be done with BS3, and has to be responsive.

In what way is the grid not compatible with BS3? Right now it even includes BS3 classes.

Note, even the current BS2 scaffolding app is responsive. Yes, the grid itself is not "responsive", but it won't be with BS3 either. There are various ways to design responsive tables, but people have different preferences for how they want to do that, and the best solution may depend on the specifics of the data being displayed. I suppose we could develop a "responsive" grid option, though that is unrelated to whether we're using BS2 or BS3 (and you would want the grid layout to work independent of the CSS framework anyway). The best approach will probably be to modularize the grid code (which has been discussed), separating the backend querying from the actual data display, which would make it easier for users to develop custom displays in the views.

Keep in mind that most server side frameworks like web2py don't include grid functionality at all. web2py can only do so much regarding grid functionality. At some point, if you need more sophisticated grid behavior, it may make sense to use a more full-featured solution, such as https://datatables.net/extensions/responsive/.

Anthony

Anthony

unread,
Jul 30, 2014, 12:52:35 PM7/30/14
to
Thanks for the answer, I was aware of that completely. It is just that Massimo said that it is trivial to replace BS2 with BS3 yet when I try to do it the trivial way and then create a FORM in controller (whether it be simple form, sqlform or sqlform.factory) the form looks completely wrong. The same is with main menu.

By trivial, I don't think Massimo meant to take templates with non-BS3 HTML structure and CSS classes and simply load the BS3 CSS file and expect to have everything work.
 
Now I know that in this case I should create form in HTML using appropriate BS3 classes and then use that form in controller but I think you will agree that this takes away the ease of use which is one of the main strengths of web2py.

First, web2py does include a BS3 formstyle, so you can simply do:

SQLFORM(..., formstyle='bootstrap3')

and assuming you have the BS3 CSS loaded, your forms should look fine.

More generally, though, web2py cannot cater to every CSS framework. Because Bootstrap is so popular, it is used for the scaffolding app, and there are built-in formstyles for BS2 and BS3. If you want to use another CSS framework, however, you can simply spend a few minutes writing a custom formstyle function, and then use that for all of your forms -- no need to write custom HTML in every form view.
 
I suppose that was why OP named this thread "Bootstrap is killing web2py". I think a lot of web2py users (like myself) are novices in web programming and while it may be trivial for versed web programmer to use BS3 with web2py it is not the case for the beginners. BS3 is more than a year old but I still develop my web apps using BS2 because that is what ships with web2py. I don't want to criticize, web2py is an excellent framework but I think it needs to ship with BS3, otherwise it will lose a lot of novice programmers and I think novice programmers are important because those are the future user base of web2py.

I agree that the scaffolding app should migrate to BS3, but this is a bit of an odd complaint. Most server side frameworks come with no scaffolding app at all. How could the lack of a BS3 scaffolding app be killing web2py if the alternatives don't offer one either? web2py certainly doesn't make it any harder to work with BS3 than any other framework, and in fact it is generally easier because web2py does include a BS3 formstyle and BS3 classes for the grid (most other frameworks don't even include a grid for that matter).

Of course it's easier if the scaffolding app already happens to be based on the CSS framework you want to use, but it really is not that difficult to take any front-end template you find and convert it to a web2py layout template, as described here. Just start with the HTML template and insert some of the web2py template code you see in the welcome layout.html, tweaked as needed. You might also keep some or all of web2py.css.

In any case, Massimo has distributed a BS3 version of the welcome app, though if you're not planning to make any layout/styling modifications anyway, it really won't be any different from using the BS2 version. On the other hand, if you need a highly customized BS3 layout or you are using a third party BS3 template, a web2py BS3 scaffolding app probably won't help you much, as you'd have to replace the layout anyway.

Anthony

Jim S

unread,
Jul 30, 2014, 1:09:33 PM7/30/14
to web...@googlegroups.com
I agree with Anthony.  What I've done with my apps is to rip apart the base layout and provide my own.  I typically find something I like in https://wrapbootstrap.com/ and update layout.html to accommodate.

-Jim



On Wednesday, July 30, 2014 11:52:35 AM UTC-5, Anthony wrote:
Thanks for the answer, I was aware of that completely. It is just that Massimo said that it is trivial to replace BS2 with BS3 yet when I try to do it the trivial way and then create a FORM in controller (whether it be simple form, sqlform or sqlform.factory) the form looks completely wrong. The same is with main menu.
By trivial, I don't think Massimo meant to take templates with non-BS3 HTML structure and CSS classes and simply load the BS3 CSS file and expect to have everything work.
 
Now I know that in this case I should create form in HTML using appropriate BS3 classes and then use that form in controller but I think you will agree that this takes away the ease of use which is one of the main strengths of web2py.

First, web2py does include a BS3 formstyle, so you can simply do:

SQLFORM(..., formstyle='bootstrap3')

and assuming you have the BS3 CSS loaded, your forms should look fine.

More generally, though, web2py cannot cater to every CSS framework. Because Bootstrap is so popular, it is used for the scaffolding app, and there are built-in formstyles for BS2 and BS3. If you want to use another CSS framework, however, you can simply spend a few minutes writing a custom formstyle function, and then use that for all of your forms -- no need to write custom HTML in every form view.
 
I suppose that was why OP named this thread "Bootstrap is killing web2py". I think a lot of web2py users (like myself) are novices in web programming and while it may be trivial for versed web programmer to use BS3 with web2py it is not the case for the beginners. BS3 is more than a year old but I still develop my web apps using BS2 because that is what ships with web2py. I don't want to criticize, web2py is an excellent framework but I think it needs to ship with BS3, otherwise it will lose a lot of novice programmers and I think novice programmers are important because those are the future user base of web2py.

I agree that the scaffolding app should migrate to BS3, but this is a bit of an odd complaint. Most server side frameworks come with no scaffolding app at all. How could the lack of a BS3 scaffolding app be killing web2py if the alternatives don't offer one either? web2py certainly doesn't make it any harder to work with BS3 than any other framework, and in fact it is generally easier because web2py does include a BS3 formstyle and BS3 classes for the grid (most other frameworks don't even include a grid for that matter).

Of course it's easier if the scaffolding app already happens to be based on the CSS framework you want to use, but it really is not that difficult to take any front-end template you find and convert it to a web2py layout template, as described here. Just start with the HTML template and insert some of the web2py template code you see in the welcome layout.html, tweaked as needed. You might also keep some or all of web2py.css.

In any case, Massimo has distributed a BS3 version of the welcome app, though if you're not planning to make any layout/styling modifications anyway, it really won't be any different from using the BS2 version.

Anthony

António Ramos

unread,
Jul 30, 2014, 1:21:20 PM7/30/14
to web...@googlegroups.com
meteorjs has a nice feature 

you want bootstrap? 
just do 
meteor add boostrap
 inside your folder app and you are good to go.







--

Anthony

unread,
Jul 30, 2014, 2:35:04 PM7/30/14
to web...@googlegroups.com
On Wednesday, July 30, 2014 1:21:20 PM UTC-4, Ramos wrote:
meteorjs has a nice feature 

you want bootstrap? 
just do 
meteor add boostrap
 inside your folder app and you are good to go.

As far as I can tell, though, that is a legacy package based on Bootstrap 2. You have to install a third party package for Bootstrap 3, and I don't think they plan to move Bootstrap 3 to the core packages. No other CSS frameworks are supported via core packages. Furthermore, I think all that gets you is the actual Bootstrap CSS and JS files, along with some minor CSS overrides. There is no HTML layout as with the web2py scaffolding app.

Anthony

Dmitry Ermolaev

unread,
Aug 1, 2014, 6:52:46 AM8/1/14
to web...@googlegroups.com
unable to install (

понедельник, 21 июля 2014 г., 12:39:56 UTC+4 пользователь Massimo Di Pierro написал:

Gael Princivalle

unread,
Nov 15, 2014, 7:21:43 AM11/15/14
to web...@googlegroups.com
Hello all.

Do we have some news about the web2py Bootstrap 3 support ?
I would like to purchase this template:
http://themeforest.net/item/metronic-responsive-admin-dashboard-template/4021469

But like a lot f fantastic templates they support only Bootstrap 3, and I'm scared about problems that could be resolved only modifying "internal" web2py code.

Bye.

Leonel Câmara

unread,
Nov 15, 2014, 7:33:25 AM11/15/14
to web...@googlegroups.com
Gael I'm using bootstrap 3 in several projects without any problem. The support for bootstrap 3 isn't stable (it might change) but it's really good enough already. The only concern with it is for SQLFORMs anyway and they already have the bootstrap3_stacked and bootstrap3_inline formstyles. I wouldn't worry about buying it I'm sure you can overcome any problems you have.

Gael Princivalle

unread,
Nov 15, 2014, 8:13:06 AM11/15/14
to web...@googlegroups.com
Thanks Leonel. I'm still using web2py 2.8.2. Do you think I must update to 2.9.11 version for a better Bootstrap support ?

----------------------
Gael Princivalle

2014-11-15 13:33 GMT+01:00 Leonel Câmara <leonel...@gmail.com>:
Gael I'm using bootstrap 3 in several projects without any problem. The support for bootstrap 3 isn't stable (it might change) but it's really good enough already. The only concern with it is for SQLFORMs anyway and they already have the bootstrap3_stacked and bootstrap3_inline formstyles. I wouldn't worry about buying it I'm sure you can overcome any problems you have.

--
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/9ipT2xkXMhc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.

Gael Princivalle

unread,
Nov 15, 2014, 8:16:43 AM11/15/14
to web...@googlegroups.com
If I use SQLFORMs with form.custom do I will avoid Bootstrap problems ?

----------------------
Gael Princivalle

Leonel Câmara

unread,
Nov 15, 2014, 10:43:38 AM11/15/14
to web...@googlegroups.com
Yes you should update as the way bootstrap3 is supported changed. Custom forms do avoid some problems but they are generally not needed.

Anthony

unread,
Nov 15, 2014, 10:46:35 AM11/15/14
to web...@googlegroups.com
As already mentioned in this thread, you can use web2py with any CSS framework without modifying any web2py internal code. web2py includes some built-in formstyles and grid UI styles for Bootstrap 2 and Bootstrap 3, but you can create your own formstyles and grid UI styles without any internal modifications.

If you upgrade your version of web2py, you will find the newer version has some additional built-in Bootstrap 3 formstyle options, but you could just as easily copy those new formstyle functions from gluon.sqlhtml.py for use in your app code. Similarly, the newer version automatically adds Bootstrap 3 classes to the grid, but again, you can simply copy those for use in your app (it's just a dict that gets passed as the "ui" parameter to the grid).

In general, it won't be any more difficult dealing with a custom Bootstrap 3 theme that you purchase than dealing with a custom Bootstrap 2 theme (or a theme based on any other CSS framework). It may take some work, but there's nothing especially problematic about Bootstrap 3 or especially easy about Bootstrap 2.

Anthony

Gael Princivalle

unread,
Nov 15, 2014, 11:06:02 AM11/15/14
to web...@googlegroups.com
Ok thank's a lot.

----------------------
Gael Princivalle

--

Guilherme Rosa

unread,
Mar 4, 2015, 2:59:28 PM3/4/15
to web...@googlegroups.com
I am running the latest version of web2py and for some reason it will not let me load the w2p file in the admin interface under "upload and instal packed application".

Anyone having this same issue?

Niphlod

unread,
Mar 4, 2015, 3:04:45 PM3/4/15
to web...@googlegroups.com


On Wednesday, March 4, 2015 at 8:59:28 PM UTC+1, Guilherme Rosa wrote:
I am running the latest version of web2py and for some reason it will not let me load the w2p file in the admin interface under "upload and instal packed application".

Anyone having this same issue?

does it say anything or it just refuses ? :D

Leonel Câmara

unread,
Mar 4, 2015, 7:48:10 PM3/4/15
to web...@googlegroups.com
You need to name the app too, just giving it the upload file is not enough.

Moiz Nagpurwala

unread,
Mar 5, 2015, 6:30:02 PM3/5/15
to web...@googlegroups.com
Hello,

I'm using latest relaease of web2py on my local machine. (2.9.12-stable+timestamp.2015.02.15.23.04.25 (Running on Rocket 1.2.6, Python 2.7.9))
Unable to install the w2p file provided for BS 3.

Please help.

Johann Spies

unread,
Mar 9, 2015, 4:45:59 AM3/9/15
to web...@googlegroups.com
Try createing a new app from the admin interface and replace it's bootstrap css-files (in static/css) and js-files (in static/js) with bootstrap3 files and see what you get.

Regards
Johann

--
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Because experiencing your loyal love is better than life itself,
my lips will praise you.  (Psalm 63:3)

Florent Chandelier

unread,
Dec 8, 2015, 2:44:47 PM12/8/15
to web2py-users
If this may be of any help to others: https://github.com/florentchandelier/web2py_BootstrapExample.

I have put together an app where I've replaced the bootstrap 2 original framework of web2py with a third-party bootstrap 3 template from graygrids. Currently I've done the initial minimal effort to make things work, but I will port the entire template to Github (out of personal interest).

This is meant to illustrate, practically, this statement "you can use web2py with any CSS framework without modifying any web2py internal code".
Thanks to all the web2py dev .... wonderful framework.

Luis Valladares

unread,
Mar 21, 2016, 11:20:59 AM3/21/16
to web2py-users
Hello!

I agree with this post subject about bootstrap killing web2py, i use web2py in 4 different projects using CSS framewors like materialize, material design lite and material-ui and its really hard to use things like SQLFORM.smartgrid because it has the classes hardcoded, maybe this can be updated and made it fully configurable to allow it to be used with other CSS frameworks?.

I know this is actually configurable but is really hard to change the classes because are too deep or too hidden.

Dave S

unread,
Mar 21, 2016, 2:01:34 PM3/21/16
to web2py-users
Look at the examples posted here with stupid.css.  There's a replacement for SQLFORM being put together, and you'll see it mentioned as Form.py; the widgets to be used with have just recently been posted.

/dps
 

Anthony

unread,
Mar 21, 2016, 3:28:15 PM3/21/16
to web2py-users

I agree with this post subject about bootstrap killing web2py, i use web2py in 4 different projects using CSS framewors like materialize, material design lite and material-ui and its really hard to use things like SQLFORM.smartgrid because it has the classes hardcoded, maybe this can be updated and made it fully configurable to allow it to be used with other CSS frameworks?.

Nothing is hardcoded, and it is already configurable. All of the Bootstrap classes are added via the existing "ui" argument, which defaults to the following dictionary:

            ui = dict(widget='',
                      header
='',
                      content
='',
                     
default='',
                      cornerall
='',
                      cornertop
='',
                      cornerbottom
='',
                      button
='button btn btn-default',
                      buttontext
='buttontext button',
                      buttonadd
='icon plus icon-plus glyphicon glyphicon-plus',
                      buttonback
='icon leftarrow icon-arrow-left glyphicon glyphicon-arrow-left',
                      buttonexport
='icon downarrow icon-download glyphicon glyphicon-download',
                      buttondelete
='icon trash icon-trash glyphicon glyphicon-trash',
                      buttonedit
='icon pen icon-pencil glyphicon glyphicon-pencil',
                      buttontable
='icon rightarrow icon-arrow-right glyphicon glyphicon-arrow-right',
                      buttonview
='icon magnifier icon-zoom-in glyphicon glyphicon-zoom-in',
                     
)

Just provide your own dictionary to use a different set of classes on the elements.

Also, please read the earlier posts in the thread. Nothing is dependent on Bootstrap, and all of the server-side code that generates UI (such as SQLFORM, MENU, auth.navbar, and the grid) was developed before Bootstrap even existed. It is also silly to suggest Bootstrap is "killing" web2py (presumably in favor of alternative frameworks) when other frameworks don't even offer functionality such as the grid. Even if the grid were not configurable, you would be no better off by going to another framework (that has no grid to begin with).

Also, note that SQLFORM and the existing grid will likely be deprecated by new functionality that is in development.

Anthony

Pierre

unread,
Mar 22, 2016, 4:57:35 AM3/22/16
to web2py-users
>Also, note that SQLFORM and the existing grid will likely be deprecated by new functionality that is in development.
>Anthony


Does this mean we should cancel code based on SQLFORM / SQLFORM.grid and wait for the new functionality ? 

Leonel Câmara

unread,
Mar 22, 2016, 5:50:20 AM3/22/16
to web2py-users
No Pierre, just use it, those will eventually be deprecated not erased immediately. Anyway, SQLFORM code will be able to use the new Form almost unchanged so it will be easy to change it later.

Pierre

unread,
Mar 22, 2016, 7:02:04 AM3/22/16
to web2py-users

Dominic Mayers

unread,
Jun 18, 2016, 8:47:42 AM6/18/16
to web2py-users
I am just starting to learn web2py and I want to better understand the issue.  Is the issue simply that Bootstrap 3 is not backward compatible with v2.x and therefore we cannot use Bootstrap3 with the templates in web2py that have been created with Bootstrap 2 ?  The issue seems to be bigger than that because we would need to modify "all parts of web2py that are tightly bound  to bootstrap", but what does this mean?  Of course, we expect a coupling between the view and the remainder of the code. The code has to provide data as expected in the view. There is no way this can be avoided, even in a loosely coupled framework. So, is this the only issue? I would like to know if there was a fundamental flaw in the design of web2py? 

Massimo Di Pierro

unread,
Jun 18, 2016, 9:27:41 AM6/18/16
to web2py-users
This is a big can of worms. CSS was created to decouple style info from structural info (HTML). Turns out most CSS today dictate both a class naming convention and an HTML structure. You cannot take an arbitrary piece of HTML and apply an arbitrary CSS. Moreover adding class names is often not sufficient. Every time you change the CSS framework you have to change the HTML. 

This is a problem for all frameworks (like web2py) that generate HTML for you. They must know what CSS framework you use. In web2py we support multiple formstyle(s):


   table3cols, table2cols, divs, ul, bootstrap (2), bootstrap3_stacked, bootstrap3_inline, inline


as you can imagine this is turning into a maintenance nightmare. This is against the original spirit. This is why I believe we need a new approach to this problem and a new library for form generation.


Massimo

Dominic Mayers

unread,
Jun 18, 2016, 1:23:07 PM6/18/16
to web2py-users
Naively, I am happy with an approach where, when we design a  controller,  we consider the HTML + CSS + javascript together as one component, a template, and we only want to know the interface to this template.  We want a clean modular interaction between these templates and the code that generates the input that these templates need. We need an abstraction layer over the templates, in the same way as we have abstraction layers over database engines.  In the case of database engines, the abstraction layer translate database queries. In the case of templates, the abstraction layer translates a dictionary into the inputs needed by the template framework, perhaps a dictionary in another format.  However, the analogy with databases is broken. We can view two different database queries for different database engines as equivalent, but we cannot view two different inputs for two different templates as equivalent, because they are fundamentally different in terms of what is presented to human beings.  So, I believe that the best we can offer on the controller side is a general language to generate dictionaries as input to template, just as web2py does. On the abstraction layer side, I am happy if, for each template framework, we have a wrapper that accepts dictionaries as input and  a documentation of this interface. This is the natural situation in standard modular programming. We simply need well documented interfaces. Of course, the more we have already used templates that we can adapt, just as in the regular web2py philosophy, the better it will be. However, in this particular case, I strongly believe that it is also important to have well documented interfaces to the templates because in some cases a start from scratch approach would be preferable. Anyway, it is also perfectly in tune with a teaching view. 

Anthony

unread,
Jun 18, 2016, 1:29:54 PM6/18/16
to web2py-users
On Saturday, June 18, 2016 at 8:47:42 AM UTC-4, Dominic Mayers wrote:
I am just starting to learn web2py and I want to better understand the issue.  Is the issue simply that Bootstrap 3 is not backward compatible with v2.x and therefore we cannot use Bootstrap3 with the templates in web2py that have been created with Bootstrap 2 ?

Yes, though this is not really an issue because even if you want a custom Bootstrap 2 theme, you still cannot simply use the existing front-end scaffolding app without making significant modifications. The front-end scaffolding application is just intended as a quick and easy starting point. If you want a custom layout, you need to implement that, and implementing a custom layout is equally easy/difficult regardless of which CSS framework you are using.
 
  The issue seems to be bigger than that because we would need to modify "all parts of web2py that are tightly bound  to bootstrap", but what does this mean?

You should read back through this thread, as that statement has been debunked. No parts of web2py are tightly bound to Bootstrap, as web2py itself predates Bootstrap. The front-end scaffolding application is based on Bootstrap 2, and web2py forms and the grid include some convenience formatting options for Bootstrap 2 and 3, but you can use all of these elements without Bootstrap at all, as they always had been used prior to Bootstrap's existence.
 
  Of course, we expect a coupling between the view and the remainder of the code. The code has to provide data as expected in the view. There is no way this can be avoided, even in a loosely coupled framework. So, is this the only issue? I would like to know if there was a fundamental flaw in the design of web2py?

Keep in mind that most server-side web frameworks don't provide a front-end scaffolding application nor built-in formatting options for any CSS frameworks. web2py happens to provide a bit more than other frameworks in this regard. Some of what it provides happens to be based on Bootstrap, but you can simply ignore all of that and use whatever CSS framework you want -- and at that point, you are no worse off than you would be with one of the many other server-side frameworks.

Anthony

Dominic Mayers

unread,
Jun 18, 2016, 6:01:18 PM6/18/16
to web...@googlegroups.com

Yes Anthony, this was my understanding, but I am glad that you confirm.  I appreciate very much the time you spent to explain. And, Yes, it was debunked and there is even a scaffolding app version with Bootstrap 3,  confirming the point.  Still, I also appreciate the response of Massimo, pointing out that there is a general difficulty in the integration of arbitrary CSS + HTML approaches into any framework. Custom layout could easily be created with bootstrap 3 and yet there was still a difficulty in the integration process.  I do believe that the difficulty is inherent to the complexity of layouts + styles, which makes more difficult the creation of an abstraction layer over templates similar to what we have in the case of database structures.       

Ramos

unread,
Jul 10, 2018, 1:05:09 PM7/10/18
to web2py-users
What is the status of this separation of web2py and bootstrap?


Regards
Reply all
Reply to author
Forward
0 new messages