Just in case anybody is interested – when a transaction fails (is rolled back), all the objects created in that transaction still respond false to new_record?, even though they are not saved to the db. One more reason to go for identity-mapping ORMs.
Archive for June, 2008
new_record?
June 11, 2008Reinventing the square wheel again
June 2, 2008There was a recent post on pylons-discuss about creating a python web framework not based on WSGI, but on higher-level abstraction – WebOb.
Well, I’m doing some research on web applications for my MSc thesis, where I’ll need a framework that is simple and stays off my way – in other words does as little to possible. I’d have used CherryPy, but I found that even it is doing too much. So, with such a suggestion on discussion list I’m trying to build a framework around WebOb.
It’s simple with a layered architecture – each layer accepts an dictionary with a few objects in it (especially webob.Request object) and returns webob.Response. The topmost layer performs application-specific tasks, while lower layers add functionality – much like WSGI middlewares. And because WebOb is a helper for WSGI, I can use any WSGI middleware.
Because of that I’m not wasting time writing things like session support – I just put beaker into the stack and wrote a simple wrapper (7 lines of code).
Perhaps I’ll release the code when it’s usable. Maybe it’ll just serve as a proof of concept – but at least I’ll have some environment for my thesis-related research.