fixup_bs3_widgets(SQLFORM) |
I think the problem with response.ui and a lot of these solutions, is that for very request I will have to be setting all of the UI again, this seems awfully inefficient to me.
--
-- mail from:GoogleGroups "web2py-developers" mailing list
make speech: web2py-d...@googlegroups.com
unsubscribe: web2py-develop...@googlegroups.com
details : http://groups.google.com/group/web2py-developers
the project: http://code.google.com/p/web2py/
official : http://www.web2py.com/
---
You received this message because you are subscribed to the Google Groups "web2py-developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py-develop...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
def fixup_bs3_widgets(SQLFORM): | |
SQLFORM.widgets.string = BS3StringWidget | |
SQLFORM.widgets.text = BS3TextWidget | |
SQLFORM.widgets.boolean = BS3BooleanWidget | |
SQLFORM.widgets.date = BS3DateWidget | |
SQLFORM.widgets.time = BS3TimeWidget | |
SQLFORM.widgets.datetime = BS3DatetimeWidget | |
SQLFORM.widgets.integer = BS3IntegerWidget | |
SQLFORM.widgets.double = BS3DoubleWidget | |
SQLFORM.widgets.decimal = BS3DecimalWidget | |
SQLFORM.widgets.password = BS3PasswordWidget |
Massimo, note that the fixup function is being called every time theres a request on menu.py, that's 10 assignments and much more lookups to get the things to assign to per request. This has to be done every request because SQLFORM starts its life every request with the wrong stuff assigned there.
I think the better solution would be for people to have themes in their app, the themes would have, among other things, a subclass of SQLFORM and have everything set for them right away as SQLFORM also includes the grid.
Massimo, note that the fixup function is being called every time theres a request on menu.py, that's 10 assignments and much more lookups to get the things to assign to per request. This has to be done every request because SQLFORM starts its life every request with the wrong stuff assigned there.I think the better solution would be for people to have themes in their app, the themes would have, among other things, a subclass of SQLFORM and have everything set for them right away as SQLFORM also includes the grid.
I agree with Leonel,Code should be clean, well documented and easy to maintain. When things get bigger they start to get messy.
--
-- mail from:GoogleGroups "web2py-developers" mailing list
make speech: web2py-d...@googlegroups.com
unsubscribe: web2py-develop...@googlegroups.com
details : http://groups.google.com/group/web2py-developers
the project: http://code.google.com/p/web2py/
official : http://www.web2py.com/
---
You received this message because you are subscribed to the Google Groups "web2py-developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py-develop...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
NB: there's a reason why I presented welcomebs3 as a POC, and not as a final plan.
I layed out the ideas in pretty much all the discussions had so far, and the same exact things continue to pop up:
- default widgets can't be adapted for every framework, so we should have them shipped in app's "department" instead of core
- handling readable = False fields as disabled inputs instead of DIVs
- grid and smartgrid needs refactoring
- "themes” support
- MENU does it job but at a high cost, almost impossible to craft to every framework
- auth forms needs additional care (think to what form.add_button() does........)
- form.errors handling makes sense only for a pretty restricted set of ui design
- etc
IMHO the rush of pushing bs3 scaffolding is unjustified at the current state, given that every discussion we had ended in pretty much nothing. We should seize the opportunity, bite the bullet and see what changes need to be made to slip in a whole new set of css rules.
There's a reason to it: everyone feels that touching the code would end up in yet another attempt to make it more complex, won't solve the "css framework lock-in" and nobody feels like doing everything in javascript on the view, and use web2py only as the MC, because at that point most of the "batteries included" arguments don't matter at all. Customizing forms with lots of js may solve the issues at hand with all defaults, but they'll make impossible to hack in a bit, resorting to code the entire form by hand.
having only response and request object to rely upon to make everything "thread-safe" is another point that pops up, but I feel that appconfig.py (or anything else like that) could solve the issue (i.e. set there some "verbose" settings loaded once-per-app in order to not repeat them in code over and over, while keeping flexibility).
While I agree on refactoring, I still see lots of users bashing around crud, which we deprecated for the exact same reason: was a good idea at the beginning, had bloated so much for each and everyone's need, got never unittested. The same is applying now to grid (and an order of magnitude more on smartgrid).
tl;dr: Ok on creating new things, but let this be the last time we end up in the same state: we should learn from the past.
No resentment. It is guilt. I feel i did not setve users well by stlll shipping bs2 and a broken Gae support. I am very grateful to you, Giovanni, michele, etc for always pushing for better and for all your work.
I see the points, although I sense a bit of resentment.... this will get newbies mad when their app based on this first incarnation on bs3 gets changed when we'll ship a better "revision", however, as long as everything gets clearly marked as experimental and we can change it as soon as better ideas pop up, I'm fine.
--
right now, in my view only sqlhtml is messy. The dal code is pretty good. The template is good. The helpers are verbose but ok. The logic in main+restricted+htttp is convoluted but I would not touch files that have not needed to be touched in ages.
It will be easy to make a grid with ractive. In the todo list.