+10, I love the idea. =Gustavo
On Monday March 16, 2009 09:18:32 Jorge Vargas wrote: > Hi, > > For some time I have been thinking on which will be the best way to > "merge" two controllers into the same PATH, percious made a suggestion > the other day on IRC which IMO is brilliant. > > it was something along the way of > > "They are classes simply make a subclass of both controllers" > > Ever since we have been using it for tgext.pages, which got me > thinking. Why don't we do that with quickstart? well here is the > result. > > The code simply splits the "RootController" into 3 controllers. > AuthenticationController (login,logout, post_login, post_logout), > DemoController (about,index,auth,manage_permission_only,editor_use_only) > and RootController (admin, error, extends both of the above) > > IMO this is > - way nicer (cleaner) than the original "everything smashed together" > approach - It introduces new and old users, to this great idea of mounting > 2 controllers to pull functionality together > - it's not magical at all (because you do know that python has > multiple inheritance do you?) > -it's also great to help non-newbies in getting rid of the "newbie" > oriented part of the quickstart. > - it simplifies the quickstart code a lot (removes a bunch of if/elif > blocks). > > In fact I think the AuthenticationController could be moved inside > /lib together with BaseController as it's something people aren't > going to change a lot. > > is this going back to the SecureController/Controller stuff? well kind > of but not really as we aren't making two separate hierarchies we are > making just one. > > PS: the code hasn't been adapted for no-auth controllers I wanted to > see if it was commitable before getting it into full shape. > > -- Gustavo Narea <xri://=Gustavo>. | Tech blog: =Gustavo/(+blog)/tech ~ About me: =Gustavo/about | --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears Trunk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/turbogears-trunk?hl=en -~----------~----~----~----~------~----~------~--~---
