I would like to save a new layer file with different definition query, but receive TypeError: 'unicode' object is not callable.
import arcpy
lyrFile = arcpy.mapping.Layer("\path to layer file\ layerFile.lyr")
field = 'Date_1'
values = "'1950'"
query=str(field) + "=" + str(values)
for lyr in arcpy.mapping.ListLayers(lyrFile, "Name of Layer"):
lyr.definitionQuery(query)
lyr.saveACopy("new layerfile.lyr")
Error I receive is:
lyr.definitionQuery(query)
TypeError: 'unicode' object is not callable
How can I adjust the code so could save layer files with different definition queries?