Problem with simple definition query expression

Discussion created by kostas_ptr88 on Apr 28, 2017
Latest reply on May 20, 2017 by Dan_Patterson

I am trying to assign a value to two shapefiles in the first data frame of my .mxd with definition query, but it seems that cannot be done.

Any suggestion? Thanks


Here is the code:

import arcpy
mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd)[0]
for lyr in arcpy.mapping.ListLayers(mxd): 
    if lyr.name == "waste": 
        lyr.definitionQuery == "Code = 'IT1300021'"