Hum. So here we are switching blogging platforms again. No matter, it’s something that comes to us all, I guess.
The story so far… Our hero faces the twin challenges of handling the questions and database for a PlayStation game whilst, simultaneously, trying to get a Zope-based website set up and running to support a consumer product launch. All whilst juggling pricess eggs in variable gravity (pace Larry Niven).
Any endeavour of this magnitude requires the proper journalling of the insights, discoveries and plain ole lessons-learned-from-screwing-up that are inevitably encountered. Hence the blog – let’s see if it dies the death of a thousand postponed entries that so many do, or thrives and prospers. Or somewhere in between.
Today’s discovery (well, yesterdays, as it happens) is that Zope has a nice little undocumented feature that damn well ought to be recorded somewhere. Consider – if you have a variable, let’s call it thingy that contains a path element, you can write a ZPT element like so:
and lo! you get the value of the variable substituted right into the path. So much nicer than doing
<span tal:replace="python:path('myroot/%s/attribute' % thingy)"/>
So why, you ask, is this little pearl not recorded anywhere that a novice in the ways of ZPT is ever likely to encounter it? Because Zope is one of those things that demonstrates both the extreme power and the essential weakness of open source (I know, I’m beginning to sound like the Architect in the Matrix now). The power, in that it’s a huge, powerfule and clever system that provides an extremely elegant and versatile way to build web applications. The weakness, in that the documentation, in the words that the Americans would use, “sucks like a Dyson on a three-phase supply”.
Well, okay, maybe it’s not that bad. There is The Zope Book, together with a whole bookmark-folder-full of hints and tips, but the documentation only generally comes in two flavours. These are:
Don’t get me wrong here… I rather like Zope. In fact, I like it more the closer I get to it, but Sweet Mother Of Abraham Lincoln, getting to it is far harder than it ought to be.