Hi, I finally found where the probleme is. It's in the file Rend.py and in the locateChild function of the class FreeformChildMixin. The problem is the content of context. To solve my problem, it was necessary to put request.context automatically in context instead of verifying if the context is empty. Otherwise the IRedirectAfterPost works once out of two. I would like to know if this change can cause many other problems and if it is possible for you to change it directly in the code so when I'll update nevow the change will be in it. Here's the class with the modification I made: class FreeformChildMixin: """Mixin that handles locateChild for freeform segments.""" def locateChild(self, request, segments): ## The method or property name we are going to validate ainst/affect bindingName = None name = segments[0] if name.startswith('freeform_post!'): configurableName, bindingName = name.split('!')[1:3] elif name.startswith('freeform-action-post!'): configurableName, request.args['freeform-actee'] = name.split('!')[1:3] bindingName = request.args['freeform-action'][0] if bindingName: #this is where I made my change #Instead of verifying if the ctx is empty, I automatically put #request.context in ctx ctx = request.context self.context = ctx ctx.remember(self, inevow.IResource) ctx.remember(request, inevow.IRequest) cf = iformless.IConfigurableFactory(self) c = cf.locateConfigurable(ctx, configurableName) return self.webFormPost(request, self, c, ctx, bindingName, request.args) return NotFound Thanks, Vicky
On May 27, 2004, at 10:34 AM, vicky wrote:
Hi,
I finally found where the probleme is. It's in the file Rend.py and in the locateChild function of the class FreeformChildMixin. The problem is the content of context. To solve my problem, it was necessary to put request.context automatically in context instead of verifying if the context is empty. Otherwise the IRedirectAfterPost works once out of two.
I would like to know if this change can cause many other problems and if it is possible for you to change it directly in the code so when I'll update nevow the change will be in it.
Can you please put a diff in the nevow issue tracker? Use 'svn diff nevow/filename.py > filename.diff' to make the diff file, then create a new issue in the bug tracker: http://www.divmod.org/users/roundup.twistd/nevow/index You should do this for each outstanding patch you have against the nevow code. If you just send code to the mailing list, it is most likely to be lost. dp
participants (2)
-
Donovan Preston
-
vicky