Has anybody tried to implement acquisition type feature in Webware? My understanding of acquisition is that a page will inherit behavior from both it's super class, and also the container that holds it. In Webware, an example would be: the index page of a folder will provide a method for making a navigation bar. Any pages in that folder or a sub folder will automatically use that navigation bar. If you move the file to another folder, it automatically picks up the new navigation bar from it's containing folder.
This doesn't seem hard from the python side, I have an example below where a class inherits from another class determined at runtime. This function could find it's parent for such an acquisition feature.
But it seems a bit tricky with Webware's structure.
-winston
-----------
from random import choice
class A(object):
def writeNavigation(self):
print "AAA"
class B(object):
def writeNavigation(self):
print "BBB"
def runtime():
return choice( [A, B] )
class C( runtime() ):
def respond( self ):
self.writeNavigation()
>>> c = C()
>>> c.respond()
AAA
>>> c = C()
>>> c.respond()
BBB
_________________________________________
winston wolff - (646) 827-2242 - http://www.stratolab.com - learning by creating