[Grok-dev] confusion

Uli Fouquet uli at gnufix.de
Tue Aug 28 11:07:52 EDT 2007


Hi JUH,

Am Dienstag, den 28.08.2007, 15:21 +0200 schrieb Jan Ulrich Hasecke:
> # this view redirects to the index-view
> 
> class Tierverkaufen(grok.View):
> 	grok.context(Gehege)
> 	grok.name('tierverkaufen')
> 	def upate(self, name):
> 		if name is None or name not in self.context.keys():
> 			return
> 		self.context.tierverkaufen(name)
> 		self.redirect(self.url('index'))
> 
> # but this view does not redirect to the index view. It always  
> behaves as if the if-condition is never False to execute the last two  
> lines.

If this code was cut'n'pasted from the source, you might consider to
rename the method from 'upate' to 'update'.

Kind regards,

-- 
Uli




More information about the Grok-dev mailing list