Hi, Please, whats wrong with this code? <dtml-let est="_['\'./'+estagio+'/aula\'']"> <dtml-call "RESPONSE.redirect(est)"> </dtml-let> estagio is a valid variable (containing the value Aul00) and Aul00 is a Folder but I get the following error: Error type - KeyError Error value - './Aul00/aula' How would be the correct way to perform that redirection? Thank you very much.
Perhaps if you omit the single quotes from the string. It looks like ./Aul00/aula may be a valid key but './Aul00/aula' is not. Leonardo Fernandes wrote:
Hi,
Please, whats wrong with this code?
<dtml-let est="_['\'./'+estagio+'/aula\'']"> <dtml-call "RESPONSE.redirect(est)"> </dtml-let>
estagio is a valid variable (containing the value Aul00) and Aul00 is a Folder but I get the following error:
Error type - KeyError Error value - './Aul00/aula'
How would be the correct way to perform that redirection?
Thank you very much.
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
-- "By all means marry, if you get a good wife you will become happy; and if you get a bad one, you will become a philosopher." -- Socrates Jason Bush | (402) 471-6517 | jason@nol.org | http://www.nol.org
I have already tried it, but get the same error, only the single quotes disappear from the error message. Jason Bush wrote:
Perhaps if you omit the single quotes from the string. It looks like ./Aul00/aula may be a valid key but './Aul00/aula' is not.
Leonardo Fernandes wrote:
Hi,
Please, whats wrong with this code?
<dtml-let est="_['\'./'+estagio+'/aula\'']"> <dtml-call "RESPONSE.redirect(est)"> </dtml-let>
estagio is a valid variable (containing the value Aul00) and Aul00 is a Folder but I get the following error:
Error type - KeyError Error value - './Aul00/aula'
How would be the correct way to perform that redirection?
Thank you very much.
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
<dtml-let est="'./'+estagio+'/aula'"> <dtml-call "RESPONSE.redirect(est)"> </dtml-let> I tried some similar code and received the same error when I removed the _[...] from the variable it worked however. I hope it helps you. Leonardo Fernandes wrote:
Hi,
Please, whats wrong with this code?
<dtml-let est="_['\'./'+estagio+'/aula\'']"> <dtml-call "RESPONSE.redirect(est)"> </dtml-let>
estagio is a valid variable (containing the value Aul00) and Aul00 is a Folder but I get the following error:
Error type - KeyError Error value - './Aul00/aula'
How would be the correct way to perform that redirection?
Thank you very much.
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
-- "By all means marry, if you get a good wife you will become happy; and if you get a bad one, you will become a philosopher." -- Socrates Jason Bush | (402) 471-6517 | jason@nol.org | http://www.nol.org
The solution below solved my problem. Thanks for the help everyone. Jason Bush wrote:
<dtml-let est="'./'+estagio+'/aula'"> <dtml-call "RESPONSE.redirect(est)"> </dtml-let>
I tried some similar code and received the same error when I removed the _[...] from the variable it worked however.
I hope it helps you.
Leonardo Fernandes wrote:
Hi,
Please, whats wrong with this code?
<dtml-let est="_['\'./'+estagio+'/aula\'']"> <dtml-call "RESPONSE.redirect(est)"> </dtml-let>
estagio is a valid variable (containing the value Aul00) and Aul00 is a Folder but I get the following error:
Error type - KeyError Error value - './Aul00/aula'
How would be the correct way to perform that redirection?
Thank you very much.
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
On Tuesday 18 March 2003 09:00 am, Leonardo Fernandes wrote:
Hi,
Please, whats wrong with this code?
<dtml-let est="_['\'./'+estagio+'/aula\'']"> <dtml-call "RESPONSE.redirect(est)"> </dtml-let>
_['foo'] means: "Look up the object with id 'foo'" So Zope is trying to look up an object with the id'./Aul00/aula', which does not exist. I assume this value is a path. In that case use: <dtml-let est="restrictedTraverse('%s/aula' % estagio)"> <dtml-call expr="RESPONSE.redirect(est.absolute_url())"> </dtml> However, you should not use DTML for this. A Python script would be clearer I think such as: est = context.restrictedTraverse('%s/aula' % estagio) context.REQUEST.RESPONSE.redirect(est.absolute_url()) hth, -Casey
estagio is a valid variable (containing the value Aul00) and Aul00 is a Folder but I get the following error:
Error type - KeyError Error value - './Aul00/aula'
How would be the correct way to perform that redirection?
Thank you very much.
participants (3)
-
Casey Duncan -
Jason Bush -
Leonardo Fernandes