On Tue, 2009-07-28 at 19:03 +0100, Alan Gauld wrote:
> There is no simpler solution without changing the class.
> If you can do that you could pass the container to the constructor
> and get the class to add itself to the container
Kent, Alan...
thank you very much, indeed I finally
"Mac Ryan" wrote
above function. In fact, as I have the need to access the object both
individually and with the dispatcher, I am doing something like this
every time I instantiate a new object:
mycontent = ContentA()
contents.append(mycontent)
...but although I "feel" this is silly, I
On Tue, Jul 28, 2009 at 1:22 PM, Mac Ryan wrote:
> def invokeAll(method, data):
> """This function is a dispatcher: it invokes all the content types
> of the application calling 'contenttype.method(data)'"""
> return [getattr(content, method)(data) for content in contents]
In Python 2.6