Function in view in model less app

22 views
Skip to first unread message

Ruud Schroen

unread,
Nov 30, 2014, 6:42:21 AM11/30/14
to web...@googlegroups.com
Hi there,

I'm building a webapp with the model less app approach by Bruno Rocha and I stumble upon a problem.
Usually when you use models you can define function which can later be used inside a view.

How would I do this with a model less approach?

Niphlod

unread,
Nov 30, 2014, 7:36:43 AM11/30/14
to web...@googlegroups.com
you're the one choosing an app without models :P there's nothing on modules that is available globally on views if not a model.
That being said, the model-less approach was done in a time where the thing that hurted performances was table definitions, that later got the possibility to be lazy-defined (hence the relatively small adoption of the model-less approach). You can still have a model that defines functions that you need globally, and it's the perfect place for them to be.

Ruud Schroen

unread,
Nov 30, 2014, 7:43:22 AM11/30/14
to web...@googlegroups.com

Hmm i didnt't know about that, i really need to check out lazy_tables. Saves me alot of time :P thanks for the info

Op 30-nov.-2014 13:38 schreef "Niphlod" <nip...@gmail.com>:
--
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 a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/1mibYB-hRrE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Anthony

unread,
Nov 30, 2014, 8:34:47 AM11/30/14
to web...@googlegroups.com
Of course, if you define a function in a module, you will need to explicitly import it. You can import it in a model file if you like.

Anthony
Reply all
Reply to author
Forward
0 new messages