Here's another one that doesn't require that you create a function
initially.
def templateDictFactory(template):
def generate(*args, **kw):
return dict(tg_template=template, **kw)
return generate
class A:
classDict = templateDictFactory(template="templateA)
@expose()
def page(self):
return self.classDict()
The advantage here is that you could expand your 'dictionary factory'
to include working with other parameters than just the template without
having to rewrite the same function each time.
-Adam
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~----------~----~----~----~------~----~------~--~---