On 07/12/06, Alberto Valverde <[EMAIL PROTECTED]> wrote:
>
>
> On Dec 7, 2006, at 3:25 PM, Ed Singleton wrote:
> >
> > Yes that did it.  I had to do a log.debug(dir(self.index)) to be
> > really sure that you meant self.index.im_func as I'd never heard of
> > im_func before.
>
> You did well, no one should believe my examples as I'm an expert at
> introducing typos... :)
>
> im_func is the unbound version of a bound method:
>
> In [1]: from new import instancemethod
>
> In [2]: def foo(self):
>     ...:     print self.msg
>     ...:
>     ...:
>
> In [3]: class Test(object):
>     ...:     def __init__(self):
>     ...:         self.foo = instancemethod(foo, self, self.__class__)
>     ...:         self.msg = "Hello world"
>     ...:
>     ...:
>
> In [4]: t = Test()
>
> In [5]: t.foo()
> Hello world
>
> In [6]: t.foo.im_func is foo
> Out[6]: True
>
> In [7]: t.foo is foo
> Out[7]: False
>
>
> >
> > The solution below works fine except for the redirect to the thank you
> > page.  I have to stop now but I'll play some more tomorrow.  I'll
> > probably fix it by adapting Matthew's single form controller so that
> > there isn't a redirect.
>
> What's the url being generated? you might need to put the full path
> or '../thank_you' (mmmm, how I like Route's "url_for"... ;)

It was redirecting me to the site homepage even if I typed the url in
manually (/register/thank_you).  I noticed I had a variable with the
same name as the method (both called thank_you) and renamed the
variable.  Now it semi-correctly redirects me to the index method of
the controller (/register).

So the redirect itself is working fine, but the thank_you method isn't
being called for some reason.

Anyway, I'll look at it tomorrow.

Thanks for all the help with this by the way.

Ed

PS Where's the best place to import new?  Should I do it in the
controller, or just remember to do it on every page where it is used?

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

Reply via email to