Re: [web2py] Best practices: When to use classes

2011-12-01 Thread Nik Go
Interesting.  Do you have any recommended links to know more about this
topic?

On Friday, December 2, 2011, Bruno Rocha wrote:

> I have an opinion about that.
>
> For me the /models folders should be renamed to /scripts since it has
> scripts that are executed in every request. Going on this approach I am
> only writing model-less (or script-less) apps.
>
> I am now recommending to all of my students and clients to avoid the use
> of models and go to class based system in modules, now with thread locals
> object and custom_importer it is very easy to create an application without
> using any model file.
>
> I encourage you to learn more about O.O in Python, then after that you can
> find a better way to create your web2py applications using modules and
> classes.
>
>
> --
>
> Bruno Rocha
> [http://rochacbruno.com.br]
>
>


[web2py] Best practices: When to use classes

2011-11-30 Thread lyn2py
Hi,

I'm obviously super new at this. I appreciate any gentle pointers,
guidelines and best practices on when to use classes when writing code
with web2py (and/or python for that matter).

I ask this because:
- In Ruby on Rails, everything is put under a class of some kind
- I have briefly seen a few discussion posts on here that have used
classes in their code
- I want to learn from experienced python coders (like you!)

Thank you.