摘要
Describe 函数将为已启用编辑者追踪的数据集返回以下属性。
要素类、表、镶嵌数据集或栅格目录属性组可以支持编辑者追踪。 仅地理数据库数据类型支持编辑者追踪属性。 返回的 dataType 是要素类、表、镶嵌数据集或栅格目录的 dataType。
属性
| 属性 | 说明 | 数据类型 | 
| editorTrackingEnabled (只读) | 如果数据集启用编辑者追踪,则返回 true。 | Boolean | 
| creatorFieldName (只读) | 包含创建要素、行或栅格的人员的用户名的字段名称。 | String | 
| createdAtFieldName (只读) | 包含创建要素、行或栅格的日期和时间的字段名称。 | String | 
| editorFieldName (只读) | 包含最近编辑要素、行或栅格的人员的用户名的字段名称。 | String | 
| editedAtFieldName (只读) | 包含最近编辑要素、行或栅格的日期和时间的字段名称。 | String | 
| isTimeInUTC (只读) | 如果 CreatedAt 字段和 EditedAt 字段中存储的时间以 UTC(协调世界时间)存储,则返回 true。 如果以数据库时间存储,则返回 false。 | Boolean | 
代码示例
以下独立脚本显示了每个用户最近编辑的要素类中的要素数量:
import arcpy
# Create a Describe object from the feature class
#
gdb_fc = "C:/data/ParcelBase.gdb/parcels_enabled"
desc = arcpy.Describe(gdb_fc)
# If the feature class has editor tracking enabled, then
#   list how many features were last edited by each user.
#
if desc.editorTrackingEnabled:
    #
    # Get the editorFieldName from the describe object
    whoField = desc.editorFieldName
    #
    # Use a cursor to search through all the features
    userDictionary = {}
    cur = arcpy.da.SearchCursor(gdb_fc, [whoField])
    for row in cur:
        featureEditedBy = row[0]
        if featureEditedBy in userDictionary:
            userDictionary[featureEditedBy] += 1
        else:
            userDictionary[featureEditedBy] = 1
    #
    # Print the results
    for user in list(userDictionary.keys()):
        if user == None:
            print('Last edited before editor tracking was enabled: '+ \
                   str(userDictionary[user]))
        else:
            print("Last edited by " + user + ": " + str(userDictionary[user]))
else:
    print('Editor tracking not enabled for '+gdb_fc)