This technique is lifted from ATContentTypes/content/image.py
def __bobo_traverse__(self, REQUEST, name):
"""Transparent access to image scales
"""
if name.startswith('image'):
field = self.getField('image')
image = None
if name == 'image':
image = field.getScale(self)
else:
scalename = name[len('image_'):]
if scalename in field.getAvailableSizes(self):
image = field.getScale(self, scale=scalename)
if image is not None and not isinstance(image, basestring):
# image might be None or '' for empty images
return image
return ATCTFileContent.__bobo_traverse__(self, REQUEST, name)
[...]
I've upgraded my laptop's Compaq nx6125 Dapper to Edgy yesterday. These are some of the issues and highlights that I encountered:
The update manager that did the upgrade it is impressive, but the update was not entirely automatically, one of the gtk engine packages kept spewing errors. The update manager was able to go over this incident in the initial phase, but terminated with an error when it was about 95% to finishing the update. [...]
I'm switching a bunch of Gnome daily used apps to their KDE counterparts. Namely I've switched from *Liferea to Akregate, from **GnoCHM to KchmViewer and from ***GIMP to Krita (Gimp sucks too much for me in terms of workflow, while Krita is more conventional and less awkward from some points of view). I'm using already using Konversation for IRC (much better then XChat, I'd use Chatzilla but it doesn't go to the systray), Tellico to keep a database of PS2 games and K3b for burning dvds. [...]
[18:43] <julesa> newbie39: To paraphrase Jon Ribbens "PHP is a minor evil perpetrated and created by incompetent amateurs, whereas Plone s a great and insidious evil, perpetrated by skilled but perverted professionals."
I admit I love being evil! :-) [...]
Every now and then I need to check the dns settings for some servers that I look after. Not being an expert, I use these two sites frequently to check that I'm not doing anything stupid:
http://www.dnsstuff.com/http://www.dnsreport.com
My preferate is dnsreport.com, but I always forget its name and its pagerank on google is not too high. So I'm doing my really really tiny bit in lifting up its page rank by linking to it on this page. [...]
To display properly, an RSS 2 feed needs to have the date entered in something resembling this format:
<pubDate>Thu, 21 Sep 2006 15:15:26 GMT</pubDate>This is needed to get a date to display in this format:
<pubDate tal:content="python: DateTime(res.Date).rfc822()"> </pubDate> [...]
>>> from zope.interface import Interface, Attribute, implementsLet's say we have an object type "Person". This person can introduce himself with the name.
class IPerson(Interface):
name = Attribute('Name of the person')
def say_name():
"""The name of the person"""
class Person(object):
implements(IPerson)
def __init__(self, name):
self.name = name
def say_name():
return 'My name is ' + self.name
Next, we have another object type, let's say "Worker", with an interface of IWorker.
class IWorker(Interface): [...]
This recipe is addressed more to the zope2/plone developer with a bit of knowledge of the zope3 universe, but not much experience in implementing the new practices.
Simply put, Five views are just like TTW python scripts, except without the limited forced security, and with the possibility to integrate them in unit testing and adapt them to other protocols then just http.
First, things should be done the newly recommended " [...]