webapp-improved icon indicating copy to clipboard operation
webapp-improved copied to clipboard

Have a look at these fixes

Open mark0978 opened this issue 14 years ago • 1 comments

I ran into some difficulty with webapp2 because of the way RequestHandler.init worked. Basically there was no way to have a derived class from RequestHandler due to the call of self.dispatch at the bottom of init.

If you called super at the beginning of your derived class init then you never executed your code. If you called it at the end, then self.request and self.response were not set when you tried to do your specific code.

I fixed all this and seeing how initialize was not callable, took a swat at fixing it too. Now, if you substitue webapp2 for webapp and the derived RequestHandler based object has an self.initialize method, it will be called (just like in webapp?).

Let me know if you see any problems with this. If you don't please feel free to include it in your code. I will license it under the same license you choose for the project.

Thanks for the good work BTW.

mark0978 avatar May 14 '11 20:05 mark0978

I made some changes to help overriding init():

https://github.com/moraes/webapp-improved/blob/master/webapp2/init.py#L126

Also please take a look at the explanation here:

https://github.com/moraes/webapp-improved/blob/master/docs/requesthandler.rst

Do you think it is ok this way?

moraes avatar May 15 '11 11:05 moraes