Yet another search mechanism... (How many of these things have I written over the years?)


Topped off the day's work by starting on the account-search mechanism (a.k.a. the phonebook). This is your bog-standard search page, it searches 4 or 5 tables with various inter-relations to produce a set of root records (accounts) that match a search string (or integer).

You can write one that's tailor-made for a given application (from scratch, using raw CGI and SQL), complete with per-column specialised display, sorting, paging, etceteras in about four hours and have time to test and tweak it to do different things for different users (depending on their access level).

I've actually lost count of just how often I've written these things. Certainly there's been one in every web framework I've ever written. There were three of them written just over the lifetime of Cinemon. They're exactly the kind of code where the effort of taking a pre-constructed solution and adapting it to a particular situation is well within striking distance of writing from scratch, and the from-scratch result is generally going to work better than the adapted version.

Which is the whole problem with web frameworks in Python. It's too darn easy to write them! The code I wrote today to do the sorting is, like all the others I've written, a class with parameterisation up the wazoo... it looks like it's part of a web framework, even though I wasn't even thinking of ever reusing the code. It's almost impossible (for me at least) not to write something framework-ish when working in Python.

Anyway, it's been a long day. I feel like just dropping off to sleep, but there's all sorts of Open Source stuff calling my name.

Comments

Comments are closed.

Pingbacks

Pingbacks are closed.