On Tue, Sep 05, 2006 at 07:21:48AM -0400, Kevin Dangoor wrote:
> 
> On Sep 5, 2006, at 4:11 AM, Timur Izhbulatov wrote:
> > Well, looks like it's possible to do the schema work somewhere in  
> > load_module.
> > But how will I use the resulting schema for validation after that?  
> > I will need
> > to make it available in the controller somehow.
> 
> Start with the schema in the controller and pass it back to the  
> template engine either via expose (I believe arbitrary arguments to  
> expose will get passed through to the template engine, but I could be  
> wrong, because that's not something I've ever used) *or* via the  
> dict. Just as TurboGears itself uses "tg_*" values that are returned  
> in the dict, you can have your template engine take advantage of  
> things that are returned in the dict.

Kevin,

Sorry, but I still don't get your idea. I agree, I can pass the schema from the
controller to the template engine through expose using its mapping argument. But
how the validate decorator will receive it than?

I mean my controller method has to be decorated by validate at the application
startup but the schema it needs will be generated by the template engine only
after the turbogears.view.base.render() function is called.

Looks like I'm missing something (this is my first TG experience). Could you
please post some code snippets for clarification?

-- 
Timur Izhbulatov
OILspace, 26 Leninskaya sloboda, bld. 2, 2nd floor, 115280 Moscow, Russia
P:+7 495 105 7245 + ext.205 F:+7 495 105 7246 E:[EMAIL PROTECTED]
Building Successful Supply Chains - One Solution At A Time.
www.oilspace.com

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to