The /@@/ resource view

I recently encountered a problem that I presume would be pretty common when creating a site based on the z3c.layer.minimal browser layer: the resources, although accessible as ++resource++resource_name, are not accessible at the default location used by packages as zc.resourcelibrary: http://localhost/site/@@/resource_name The reason, as I have guessed, was that a certain page or view was missing, not being registered for the IMinimalLayer, which doesn't inherit from the IBrowserDefaultLayer. Grepping for " [...]

Better load time for Plone sites

You probably know by now that Plone sites are better suited at content creation that content delivery. Still, the Plone solution is too good to pass even when creating simpler sites, where +99% of the trafic will be anonymous one. And when you have a good hammer, everything looks like a nail. One of the various problems that Plone has when delivering this brochure type of websites is that the page weight is pretty high. [...]

Problems with migrating AT content from Plone 2.0 to Plone 2.5

Latest problem that ate too much of my life already (took me a night to get through) was importing some content from a Plone 2.0 site to a new instance of Plone 2.5. The old content was created using an old version of AT (probably 1.2). To prepare the migration I've created a new content type using ArchGenXML that mimicked the old product name, classes and fields and exported the content from the old Zope instance as a . [...]

Hosting Zope 3 on FreeBSD

Today I had to setup the hosting of a Zope 3 application on a FreeBSD server. I don't have much love for FreeBSD as I'm used to the Debian way of doing things, but after a couple of hours of tweaking the apache configuration files and the application I managed to get it properly running on that server. Some pointers to quickly getting things done: default apache on FreeBSD doesn't have mod_proxy installed. [...]

Firebug getting close to 1.0

Wow! I am impressed. Following a discussion on slashdot I've installed the new 1.0 beta version of Firebug, an extension for web developers. Created by the same author as the classic Dom Inspector, Firebug didn't seem too useful for me until now. The version on the mozilla extensions site is old (0.4), not so featured and to me it seemed to be really buggy. The new version seems to work very good and offers for each area of focus a multitude of information and options that puts it on first place in my toolkit as Plone web developer. [...]

Why do the GIMP developer hate us?

I'm working on a website for which I have received PSD templates and I just need to do a Plone skin based on the templates. I'm using GIMP for various tasks, like trimming images, exporting for web, etc. Now that I have mapped some key shortcuts to their old Photoshop equivalents, to which I am used, Gimp seems more bearable. Not by much, though. Why do the Gimp developers decided that it's a cool and clever idea to develop this application in this way? [...]

Permission problems with adapters

Recently I encountered a permission problem that I guess can be tipical when working with adapters based on marker interfaces (such as implementing IRatableItem with a class and adapting it to IRating). The code is classic simplistic example of adaptation, using the IAnnotation to store a rating, with the adapter being something along these lines: from interfaces import IRating from zope.annotation.interfaces import IAnnotations from zope.interface import implements class RatingAdapter(object): implements(IRating) [...]

Setting a dynamic i18n:domain in a ZPT template

<h2 tal:define="statusMessage python:request.get('statusMessage'); domain python:request.get('domain')" tal:attributes="i18n:domain domain; i18n:translate string:">someText</h2> [...]

Getting the parent object in an acquisition context

To get the parent of an object, you'd have to use this code: myparent = aq_inner.aq_parent.aq_self [...]

One liner to get the common elements of several lists

While doing an exercise with a mockup catalog and indexes, I ran into the problem of filtering several lists and returning the common elements from the list. The following example demonstrate the usage of reduce(), one of the functional programming constructs that are less common and obvious in their usage. >>> a = [1,2,3,4] >>> b = [2,3,4,5] >>> c = [1,2,4,6] >>> d = [0,2,3] >>> z = [a,b,c,d] [...]