[Zope] Problem Augmented assignment

julian jules12af at aol.com
Mon Jun 4 04:24:50 EDT 2007


Hi,

I have change my zope version, zope 2.7 to zope 2.9. In zope 2.7 I have 
some python script that run very well. But in zope 2.9 theses scripts 
don't run. This script use the parameter in url send with a checkbox 
form. I have exactly the same code in zope2.7 and zope2.9. :s

In zope 2.9 I have this error message :
---------------------------------------------------------------------------
Type de l'erreur
     TypeError
Valeur de l'erreur
     Augmented assignment to And objects is not allowed in untrusted code
Requête envoyée au serveur le
     2007/06/04 10:18:18.412 GMT+2
---------------------------------------------------------------------------

---------------------------------------------------------------------------
  My python script :
---------------------------------------------------------------------------
from Products.PythonScripts.standard import html_quote
from Products.AdvancedQuery import Eq, And, Or
request = container.REQUEST
RESPONSE =  request.RESPONSE


query = And(Eq('portal_type', 'J_Product'))
query &= Eq('review_state', 'published')

query2 = Or()

if type1 != None:
    query2 |= Eq('getJ_product_type', int(1))

if type2 != None:
    query2 |= Eq('getJ_product_type', int(2))

if type3 != None:
    query2 |= Eq('getJ_product_type', int(3))

if type4 != None:
    query2 |= Eq('getJ_product', int(4))

if type5 != None:
    query2 |= Eq('getJ_product', int(5))

if type6 != None:
    query2 |= Eq('getJ_product', int(6))

if type1 != None or type2 != None or type3 != None or type4 != None or 
type5 != None or type6 != None :
   query &= query2


resultat_association = context.portal_catalog.evalAdvancedQuery(query)

sort_on_pr = (("Title","strcoll_nocase","asc"),)

tri_product =sequence.sort(resultat_product, sort_on_pr)

return tri_product
----------------------------------------------------------------------------------

Thanks,

Julian



More information about the Zope mailing list