>
> It's difficult, for instance, to create modules that factor out db-centric
> code, because the db object (typically defined in a model file) won't be
> available; this forces you to reimplement the wheel to some extent by
> taking the db-creation code out of a plain model file and put it in a
> function --- which then breaks things like the db-admin tool.
>
You can create the db object in a model and then pass it to functions
defined in a module. This is how Auth works, and you will notice all the
Auth tables are accessible via appadmin.
Obviously these are complex issues, but in the end I think it would be
> ideal to find a way that makes simple things smooth without making more
> complex code interdependencies quite so painful. (Importing rather than
> executing code may help in this regard.)
>
I believe that is indeed the plan for web3py.
> I do think, though, that this is something that could be added to the
> existing web2py without requiring a wholesale rewrite; it basically amounts
> to adding more full-featured client-side tools, with linkups to the server,
> so that instead of using SQLFORM or whatever you can just have a series of
> <INPUT> elements in a view along with a {{=submitAjax}} or something that
> causes them to do their thing independent of the rest of the page. The
> "components" model seems to be something along these lines but from what I
> see it is still a good deal less comprehensive than the whole
> form/validator mechanism available to "real" forms.
>
You can put anything that would go on a full page (including any form) in
an Ajax component. Forms in components are submitted via Ajax (they are no
less "real" than forms loaded in full pages), and only the component itself
refreshes upon submission. It is not quite clear what else you are looking
for.
Anthony
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.