I'm trying to understand the editor in arcpy and I notice there is a startEditing method and a startOperation method. I'm wondering what the cadence is to using the startOperation method, I don't really get what it's purpose is. Right now, this is essentially how I do my edits:
collector_db_con <SPAN class="operator token">=</SPAN> r<SPAN class="string token">"Database Connections\CollectorSpatialData_CollectorWriter.sde"</SPAN>
editor <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>da<SPAN class="punctuation token">.</SPAN>Editor<SPAN class="punctuation token">(</SPAN>collector_db_con<SPAN class="punctuation token">)</SPAN>
editor<SPAN class="punctuation token">.</SPAN>startEditing<SPAN class="punctuation token">(</SPAN><SPAN class="token boolean">False</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="token boolean">False</SPAN><SPAN class="punctuation token">)</SPAN>
editor<SPAN class="punctuation token">.</SPAN>startOperation<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token">#Create cursor one</SPAN>
<SPAN class="comment token">#Do insert/update</SPAN>
<SPAN class="comment token">#Delete cursor one</SPAN>
<SPAN class="comment token">#Create cursor two</SPAN>
<SPAN class="comment token">#Do insert/update</SPAN>
<SPAN class="comment token">#Delete cursor two</SPAN>
<SPAN class="comment token">#Create cursor three</SPAN>
<SPAN class="comment token">#do insert/update</SPAN>
<SPAN class="comment token">#Delete cursor three</SPAN>
editor<SPAN class="punctuation token">.</SPAN>stopOperation<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
editor<SPAN class="punctuation token">.</SPAN>stopEditing<SPAN class="punctuation token">(</SPAN><SPAN class="token boolean">True</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">del</SPAN> editor<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
Are you supposed to be using start/stop operation more like this, or like if you were switching between editing different feature classes in the same geodatabase?
collector_db_con <SPAN class="operator token">=</SPAN> r<SPAN class="string token">"Database Connections\CollectorSpatialData_CollectorWriter.sde"</SPAN>
editor <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>da<SPAN class="punctuation token">.</SPAN>Editor<SPAN class="punctuation token">(</SPAN>collector_db_con<SPAN class="punctuation token">)</SPAN>
editor<SPAN class="punctuation token">.</SPAN>startEditing<SPAN class="punctuation token">(</SPAN><SPAN class="token boolean">False</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="token boolean">False</SPAN><SPAN class="punctuation token">)</SPAN>
editor<SPAN class="punctuation token">.</SPAN>startOperation<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token">#Create cursor one</SPAN>
<SPAN class="comment token">#Do insert/update</SPAN>
<SPAN class="comment token">#Delete cursor one</SPAN>
editor<SPAN class="punctuation token">.</SPAN>stopOperation<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
editor<SPAN class="punctuation token">.</SPAN>startOperation<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token">#Create cursor two</SPAN>
<SPAN class="comment token">#Do insert/update</SPAN>
<SPAN class="comment token">#Delete cursor two</SPAN>
editor<SPAN class="punctuation token">.</SPAN>stopOperation<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
editor<SPAN class="punctuation token">.</SPAN>startOperation<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token">#Create cursor three</SPAN>
<SPAN class="comment token">#do insert/update</SPAN>
<SPAN class="comment token">#Delete cursor three</SPAN>
editor<SPAN class="punctuation token">.</SPAN>stopOperation<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
editor<SPAN class="punctuation token">.</SPAN>stopEditing<SPAN class="punctuation token">(</SPAN><SPAN class="token boolean">True</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">del</SPAN> editor<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>