Hi guys!
I want to implement something similar to zope's aquisition using
automatic class generation... I have a structure similar to the follow
(usign cheetah):
Standard package (maybe a Kit)
\-> Design.tmpl/py - the design (not generated by myself)
\-> Model.py - the design extended with some additional things...
\-> Test1.py - a dinamic page generated by myself
\-> Teste2.tmpl/py - a static page generate by design team
Another specific package
\-> Design.tmpl/py - made by the design team
\-> Model.py - extension of the design
\-> Main.tmpl/py
\-> Page1.tmpl/py
\-> Test2.py - a extension of the Test2 from standard package
The question is about the Test2 contruction, the Test2.tmpl is a
standard page that needs to be shown on each site, but it needs to fit
the site design and model.
I done this:
#--------------------------
from Model import Model
from sys import path
path.append('/path-to-standard-package')
from StandardPackage.Test import Test
_Test=Test # to avoid conflicts
class Test(Modelo, _Test):
title=_Test.title
def writeBody(self, trans):
_Test.writeBody(self, trans)
#--------------------------
The writeBody is like a writeContent of Page class, this way I can use
only the content of the page...
I ask now, is there a quick way or a better way to do this task? I
think in create a function that returns the class created, but I'm too
newbie :). With the function I can do:
#------
from Model import Model
from sys import path
path.append('/path-to-standard-package')
from StandardPackage.Test import Test
Test=MakeClass(Model, Test)
#------
Is there a way to automatic create classes? Any direction would be
helpless, thanks for help!
bie
=====
--
Michel Thadeu Sabchuk
Curitiba/PR
_______________________________________________________
Yahoo! Mail agora com 100MB, anti-spam e antiv�rus gr�tis!
http://br.info.mail.yahoo.com/
-------------------------------------------------------
This SF.Net email is sponsored by OSTG. Have you noticed the changes on
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technology
Group. Come see the changes on the new OSTG site. www.ostg.com
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss