Using views as information mixins in templates

This may be basic trick for some, a non-obvious usage of views for others, who knows, I'm documenting it here anyway. I've been using this technique for quite some time without giving it much thought. There are times when I have an object in a template. I want to display information associated with that object. This information is already coded in a @@detail view on this object. Suppose this example (in mostly pseudocode): [...]

In case you're having problems installing ssl-for-setuptools...

I've stumbled on this error when trying to install a easyshop buildout: Exception: No SSL support found An error occured when trying to install ssl-for-setuptools 1.10.Look above this message for any errors thatwere output by easy_install. While: Installing instance. Getting distribution for 'ssl-for-setuptools'. Error: Couldn't install: ssl-for-setuptools 1.10 After scratching my head for a while, I've found the solution: # apt-get install libssl-dev [...]

A tip on debugging Zope 2 with ZEO

I'm having some troubles with CacheFu, and I've resorted to deleting some objects from a debug prompt, which is very easy to get at if one runs the Zope under ZEO. Still, I couldn't delete the objects because I was getting Unauthorized errors. Luckily, there is #plone, from which I got the following tip: <naro> from AccessControl.SecurityManagement import newSecurityManager <naro> user = app.acl_users.getUser('admin') <naro> newSecurityManager(None, user) Thanks, naro!  Update: I realize now that I didn't write how to connect to ZEO: [...]

Ubuntu Hardy Heron: some things are bad

Note to self: always create a root account on Ubuntu. I've updated my laptop to Kubuntu Hardy Heron, and while some things worked fine, there are a couple of stupid bugs that chained to make my life hard. First of all, why did the Network Configuration applet in Settings Manager in KDE saw fit to delete the hostname of my localhost, tibi-laptop, from /etc/hosts? Now I can't run anything with sudo, as it imediately aborts with an error " [...]

Why do I use Zope 3?

I'm in the process of beginning a new project and I'm debating on what framework to use. Of course it will be Zope 3, but why do I use it. Well, it's sure something that has to do with these facts: it's open source, with a strong, mature community around itwhile it's still actively development, it has a stable API it's written in Python, one of the easiest and most powerful languagesit's built around a component architecture, which means writing pluggable applications comes naturallysolves the problem of publishing objects through the webeverything is transaction based. [...]

A few ATReferenceBrowserWidget tips

On a Plone 2.5 project I'm working I have a content type that has 3 reference association to another content type. ArchGenXML generated the fields with the same name, which means that in the interface there will be just one field, as they overwrite each other. To have them working I need to rename them, but how to do this from the model? Agx, at first glance, doesn't have support for this. [...]

GHOP Plone skins overview

Plone has very few skins available from the community, when compared to just about anything. The skin incompatibilities that appeared between Plone versions 2.0/2.1/3.0 further deepen this problem. As a result of the 2007 Plone - GHOP there are some skins placed in the collective, but they're not visible anywhere (they're not published in the PSC, only some of them are available as eggs in PyPI, to get a glimpse of them you need to install them). [...]

Tutorial: run ArchGenXML 2.0 under virtualenv

The "modern" (post 1.5) version of ArchGenXML is packaged as egg, available on pypi. While in theory you could run "sudo easy_install archgenxml" and have it running with minimal effort, because it depends on zope.component and zope.configuration, things tend to get muddy and complicated. If you'll "easy_install zope.component" you'll get a bunch of zope eggs installed in python's site-packages and this will probably cause problems. When I've started developing with Zope 3 I had some hard time tracking some problems that ultimately turned out to be caused by zope packages installed in the system python " [...]

The 763 projects in the Collective SVN

Today I was curious about the number of projects found in the collective svn. They always seemed a lot, but I never knew how many. Until today, when I ran a xpath query over the subversion page and I found that there are 763! This number shocked me, I was expecting at most 200. My number of projects there is very small though, I can only claim ownership over 2 of them. [...]

Monty Python sketches and download script

A friend pointed me to a page with many many links to Monty Python sketches videos. Being a Monty Python fan, I've countered with this script: #!/usr/bin/python2.4 downloader = "/home/tibi/Software/youtube-dl.py '%s' -o '%s'" url = "http://onemansblog.com/2006/12/01/a-compendium-of-150-monty-python-sketches/" import lxml.html import urllib import os content = urllib.urlopen(url) etree = lxml.html.parse(content) links = etree.xpath('//ol/li/a') for link in links: print "Downloading ", link.text cmd = downloader % (link.get('href'), link.text + '.flv') print os.popen(cmd).read() It needs the YouTube downloader script and lxml 2. [...]