Okay so I figured this out :
Let's say I have a "item" table in my model and I have a controller
method that returns a variable to a template and the variable is
called item.
like this :
@expose(template.mytemplate)
def mymethod(self):
return dict(item = something)
It appears that the template will actually take the table and not the
actual object.
Now I do't mind changing the name in the return dict to avoid that but
can someone explain to me why it does this and if there's a way to go
around it ?
Thanks
On Feb 11, 12:00 pm, zaf <[email protected]> wrote:
> Thanks, I changed the name of the variable where the function was
> called and it works (well not exactly but it's not that error
> anymore :P)
> And the Genshification continues.
> Tom
>
> On Feb 11, 11:35 am, Florent Aide <[email protected]> wrote:
>
> > On Wed, Feb 11, 2009 at 11:19 AM, zaf <[email protected]> wrote:
>
> > > Hi guys,
> > > In order to improve our app's response time I decided to upgrade to
> > > genshi. Seemed straight forward enough and I figured I should do it
> > > while I still have a manageable amount of templates.
> > > It worked fine for simple templates however when I have a $
> > > {obj.member} element such as in the input below:
>
> > > <div py:def="addsocieteformfunc(s)" >
>
> > s is a table and not a mapped class instance (from what I can see in
> > your traceback)... if you indeed want to work on the table then try:
>
> > ${s.c.id_societe}
>
> > if you wanted to work on a societe object then the code you show is
> > good but you are calling the function with the wrong s argument.
>
> > Florent.
>
>
--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---