<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Enabling Editor TRacking on New and Old FC in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/enabling-editor-tracking-on-new-and-old-fc/m-p/557290#M43560</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have multiple GDBs with tons of FDS and I need to determine if they have editor tracking enabled (got that part), and if they dont I need to Know the following :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Case 1: Does the FC have the old default fields: ET_CREATOR.... ect&lt;/P&gt;&lt;P&gt;Case 2: Does the FC have the new default fields: created_user... ect&lt;/P&gt;&lt;P&gt;Case 3: Does the FC have both sets of default fields. &lt;/P&gt;&lt;P&gt;Case 4: The FC doesnt have any of the Editior Tracking default fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For case 1 and 2 I would like to enable editor tracking on the exsisting fields.&lt;/P&gt;&lt;P&gt;For case 3 I would like to copy the data from the old default fields to the new default fields and remove the old fields, then enable tracking on the new fields.&lt;/P&gt;&lt;P&gt;For case 4 I would like to enable tracking and except the default fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Im thinking that tackling the Case 3 data transfer and field removal should be done first. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have very little python expierience and would a ppreciate tons of comments. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Heres where Im at now, I will attach a copy aswell: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;import os&lt;/P&gt;&lt;P&gt;import string&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#Set the workspace environment&lt;/P&gt;&lt;P&gt;arcpy.env.workspace = r"Z:\TempTablesTBD\Test.gdb"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#Define datasets, get dataset list&lt;/P&gt;&lt;P&gt;datasets = arcpy.ListDatasets(feature_type='feature')&lt;/P&gt;&lt;P&gt;datasets = [''] + datasets if datasets is not None else []&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Define descrete arrays to pass the data to (final resting place) arrays are by default unicode&lt;/P&gt;&lt;P&gt;enabledList = []&lt;/P&gt;&lt;P&gt;notEnabledList = []&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#List FC in a GDB including those in an FDS but iterating through the datasets&lt;/P&gt;&lt;P&gt;#for a full path name replace (ds, fc) with (arcpy.env.workspace,ds,fc)&lt;/P&gt;&lt;P&gt;for ds in datasets:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for fc in arcpy.ListFeatureClasses(feature_dataset=ds):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fcList = os.path.join(ds, fc)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#Report if Editor Tracking is Enabled or NOT Enabled&lt;/P&gt;&lt;P&gt;#Create the describe object&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; desc = arcpy.Describe(fc)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#Create temporary lists in the loop to pass the info THROUGH, type is defined as string with str&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; t_enabledList = str('\t' + '-' + ds + '\n' + '\t\t' + fc)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; t_notEnabledList = str('\t' + '-' + ds + '\n' + '\t\t' + fc)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#Loop to determine Editor Tracking status&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if desc.editorTrackingEnabled:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Final resting place for enabled item names (FDS/FC)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; enabledList.append(t_enabledList)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Final resting place for non-enabled item names (FDS/FC)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; notEnabledList.append(t_notEnabledList)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#Loop through all values returned and print each separately, with out the loop they will print as a single&lt;/P&gt;&lt;P&gt;#illiterate string.&lt;/P&gt;&lt;P&gt;print ('Enabled:&amp;nbsp; ')&lt;/P&gt;&lt;P&gt;for enable in enabledList:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print (enable)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;print ('NOT Enabled on:&amp;nbsp; ')&lt;/P&gt;&lt;P&gt;for notEnabled in notEnabledList:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print (notEnabled)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#Script is complete&lt;/P&gt;&lt;P&gt;print ('\n\n\n'+'Complete :)')&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 Jun 2015 14:58:30 GMT</pubDate>
    <dc:creator>JacquelineAlessi</dc:creator>
    <dc:date>2015-06-03T14:58:30Z</dc:date>
    <item>
      <title>Enabling Editor TRacking on New and Old FC</title>
      <link>https://community.esri.com/t5/python-questions/enabling-editor-tracking-on-new-and-old-fc/m-p/557290#M43560</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have multiple GDBs with tons of FDS and I need to determine if they have editor tracking enabled (got that part), and if they dont I need to Know the following :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Case 1: Does the FC have the old default fields: ET_CREATOR.... ect&lt;/P&gt;&lt;P&gt;Case 2: Does the FC have the new default fields: created_user... ect&lt;/P&gt;&lt;P&gt;Case 3: Does the FC have both sets of default fields. &lt;/P&gt;&lt;P&gt;Case 4: The FC doesnt have any of the Editior Tracking default fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For case 1 and 2 I would like to enable editor tracking on the exsisting fields.&lt;/P&gt;&lt;P&gt;For case 3 I would like to copy the data from the old default fields to the new default fields and remove the old fields, then enable tracking on the new fields.&lt;/P&gt;&lt;P&gt;For case 4 I would like to enable tracking and except the default fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Im thinking that tackling the Case 3 data transfer and field removal should be done first. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have very little python expierience and would a ppreciate tons of comments. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Heres where Im at now, I will attach a copy aswell: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;import os&lt;/P&gt;&lt;P&gt;import string&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#Set the workspace environment&lt;/P&gt;&lt;P&gt;arcpy.env.workspace = r"Z:\TempTablesTBD\Test.gdb"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#Define datasets, get dataset list&lt;/P&gt;&lt;P&gt;datasets = arcpy.ListDatasets(feature_type='feature')&lt;/P&gt;&lt;P&gt;datasets = [''] + datasets if datasets is not None else []&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Define descrete arrays to pass the data to (final resting place) arrays are by default unicode&lt;/P&gt;&lt;P&gt;enabledList = []&lt;/P&gt;&lt;P&gt;notEnabledList = []&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#List FC in a GDB including those in an FDS but iterating through the datasets&lt;/P&gt;&lt;P&gt;#for a full path name replace (ds, fc) with (arcpy.env.workspace,ds,fc)&lt;/P&gt;&lt;P&gt;for ds in datasets:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for fc in arcpy.ListFeatureClasses(feature_dataset=ds):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fcList = os.path.join(ds, fc)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#Report if Editor Tracking is Enabled or NOT Enabled&lt;/P&gt;&lt;P&gt;#Create the describe object&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; desc = arcpy.Describe(fc)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#Create temporary lists in the loop to pass the info THROUGH, type is defined as string with str&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; t_enabledList = str('\t' + '-' + ds + '\n' + '\t\t' + fc)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; t_notEnabledList = str('\t' + '-' + ds + '\n' + '\t\t' + fc)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#Loop to determine Editor Tracking status&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if desc.editorTrackingEnabled:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Final resting place for enabled item names (FDS/FC)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; enabledList.append(t_enabledList)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Final resting place for non-enabled item names (FDS/FC)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; notEnabledList.append(t_notEnabledList)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#Loop through all values returned and print each separately, with out the loop they will print as a single&lt;/P&gt;&lt;P&gt;#illiterate string.&lt;/P&gt;&lt;P&gt;print ('Enabled:&amp;nbsp; ')&lt;/P&gt;&lt;P&gt;for enable in enabledList:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print (enable)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;print ('NOT Enabled on:&amp;nbsp; ')&lt;/P&gt;&lt;P&gt;for notEnabled in notEnabledList:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print (notEnabled)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#Script is complete&lt;/P&gt;&lt;P&gt;print ('\n\n\n'+'Complete :)')&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jun 2015 14:58:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/enabling-editor-tracking-on-new-and-old-fc/m-p/557290#M43560</guid>
      <dc:creator>JacquelineAlessi</dc:creator>
      <dc:date>2015-06-03T14:58:30Z</dc:date>
    </item>
    <item>
      <title>Re: Enabling Editor TRacking on New and Old FC</title>
      <link>https://community.esri.com/t5/python-questions/enabling-editor-tracking-on-new-and-old-fc/m-p/557291#M43561</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just a side note: if you are posting code for others to review you should post it with syntax highlighted as it will be easier to read. Here is a &lt;A _jive_internal="true" href="https://community.esri.com/people/curtvprice/blog/2014/09/25/posting-code-blocks-in-the-new-geonet"&gt;page&lt;/A&gt; to help you edit your original question.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jun 2015 14:19:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/enabling-editor-tracking-on-new-and-old-fc/m-p/557291#M43561</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2015-06-08T14:19:29Z</dc:date>
    </item>
  </channel>
</rss>

