I think I'm in a pretty good position to talk about modifying things in 
web2py as I recently took the template engine created for web2py and 
separated it out as a library that can be integrated with other projects. 
In addition, I've been using the framework since ~ late 2008.

There are several layers of which you may be speaking when you ask how easy 
it is to 'pull apart things and modify them as needed'. 

web2py (The framework as a whole): 
   web2py's execution model is different from any other MVC-centric python 
framework I've seen, giving it great flexibility. This does mean however 
that  you need to be aware of the way your code is run if you're going to 
swap out components.

DAL (models):
   I'm not aware of anyone who's completely replaced the DAL with another 
persistence interface. With that said; almost every option in the DAL can 
be overridden. This goes not only for the defaults set when you define your 
models but also in the controllers when you Create/Read/Update/Delete items 
from the models defined. You get a level of flexibility that doesn't exist 
in any ORM that I know of.

Controllers: 
  You may not know that your controllers play a role in your URLs (by 
default). This can be changed with custom routes. Also by default web2py 
presumes that you'll use controller-files with action-functions. It's 
pretty easy to change this and use Class based controllers if you really 
want, or to extend functions to fill the role of controller+action. The 
request and response objects make this almost trivial. A good testament to 
this are the services APIs (covered in the book). 

Template/Views:
  The template engine in web2py can be changed out for something else like 
jinja or mako if you really want that. You'll need to understand how they 
handle escaping and passing the string to be parsed but it's been done a 
number of times before. Many end up switching back because the web2py 
template system offers some huge advantages over the alternatives.


In short almost every nob can be tweaked (without modifying the framework). 
If you want to pull stuff out and replace it with other stuff thats a 
little bit more challenging but it can be done. Web2py is exceedingly 
flexible and easy to tweak.


I hope this helps..

On Monday, July 9, 2012 3:46:24 AM UTC-5, murtaza52 wrote:
>
> Massimo,
>
> Appreciate your comments.
>
> As mentioned by you, web2py has packaged all the functionality needed  by 
> a web app in a single api, and I am finding this very interesting. This 
> certainly allows one to create a web app pretty fast.
>
> The only remaining question is that how easy is it to pull apart things 
> and modify them as needed. As I understand web2py will certainly speed up 
> my development. However when I need flexibility will I still be easily able 
> to change defaults and tweak things ? ( something that loosely couple 
> frameworks provide over full stack frameworks)
>
> Thanks,
> Murtaza
>
> On Saturday, July 7, 2012 1:26:34 AM UTC+5:30, Massimo Di Pierro wrote:
>>
>> As pointed out what I said is that I would pick ROR of "most" python 
>> frameworks.
>>
>> In general I prefer to program in Python rather then  Ruby. Indentation 
>> makes the code more readable and there are more libraries. Ruby is used in 
>> Rails but not much else. Python is used for all kind of things (think about 
>> numpy, blender, pyglet, etc.).
>>
>> Yet Ruby is better designed than most Python framework because if favors 
>> convention over configuration. Most Python frameworks instead follow the 
>> Python motto "explicit is better the implicit" and the authors despise the 
>> concept of "default behaviour" which they refer to as "magic". This means 
>> that even very simple simple such as serving a static file require a fair 
>> amount of programing. Moreover, as a corollary, most frameworks come in 
>> pieces. Ever piece has a name and its own marketing people. This exposes 
>> the visibility of the component but it means you have to separately find 
>> and install the components you need, learn their api and make sure they are 
>> compatible with your own version of the code.
>>
>> In web2py we tried to copied the RoR approach (everything has a 
>> configuration) and we try to package and maintain as many components as 
>> possible into the same code base (API for authentication, scheduler, cron, 
>> PDF printing, SOAP services, WIKI markup, syntax highlighting, etc.). 
>> Moreover we do not rely on third party modules (only on Python standard 
>> libraries). 99% of what you may want to can be done with basic web2py 
>> without needing external packages. This means the apps are very portable 
>> between one installation and another.
>>
>> The main difference between web2py and other frameworks in practice is 
>> not soo much in the its API (which more or less are the same for all 
>> frameworks) but for what web2py does for you on the management site: no 
>> packages to install, manage through the web interface, no shell programming 
>> unless you want to, automatic migrations.
>>
>> Massimo
>>
>>
>>
>> On Friday, 6 July 2012 00:58:36 UTC-5, murtaza52 wrote:
>>>
>>> Hi,
>>>
>>> I am considering three frameworks for developing our commercial 
>>> applications- 
>>>
>>> 1) web2py (choice #1)
>>> 2) ROR
>>> 3) Play framework
>>>
>>> While my research I was intrigued by Massimo's post where he says that 
>>> he would pick ROR over any of the current python frameworks. My question is 
>>> how does web2py itself compare to ROR ? What are the views of those 
>>> experienced with both the ecosystems ? 
>>>
>>> http://www.ruby-forum.com/topic/209343
>>>
>>> I have expereince with none so will rely on your answers :) The purpose 
>>> of the question is not to start a flame war, but to understand why should 
>>> web2py be chose over other frameworks which have much more traction today?
>>>
>>> Thanks,
>>> Murtaza
>>>
>>>

Reply via email to