<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body style='font-size: 10pt; font-family: Verdana,Geneva,sans-serif'>
<p>You need to write t back to the feature, e.g. by</p>
<p>feat['assessment_investigator_actor'] = t</p>
<p><br /></p>
<p>Greetings,</p>
<p>Benjamin</p>
<p><br /></p>
<p id="reply-intro">On 2021-05-04 19:59, Enzo Cocca wrote:</p>
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0">
<div id="replybody1">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">Hi people:
<div>I'm trying to update an table sqlite not geometric but the update does not take place.</div>
<div> </div>
<div>this is my code:</div>
<div> </div>
<div>
<div>def convert_table(self):</div>
<div>        cfg_rel_path = os.path.join(os.sep, 'HFF_DB_folder', 'config.cfg')</div>
<div>        file_path = '{}{}'.format(self.HOME, cfg_rel_path)</div>
<div>        conf = open(file_path, "r")</div>
<div>        con_sett = conf.read()</div>
<div>        conf.close()</div>
<div>        settings = Settings(con_sett)</div>
<div>        settings.set_configuration()</div>
<div>        if settings.SERVER == 'sqlite':</div>
<div>            sqliteDB_path = os.path.join(os.sep, 'HFF_DB_folder', settings.DATABASE)</div>
<div>            db_file_path = '{}{}'.format(self.HOME, sqliteDB_path)</div>
<div>            uri = QgsDataSourceUri()</div>
<div>            uri.setDatabase(db_file_path)</div>
<div>            uri.setDataSource('','eamena_table', None,'')</div>
<div>            layerEamena=QgsVectorLayer(uri.uri(), 'eamena_table', 'spatialite')</div>
<div>            QgsProject.instance().addMapLayers([layerEamena], True)</div>
<div>            layer =  QgsProject.instance().mapLayersByName('eamena_table')[0]</div>
<div>            with edit(layer):</div>
<div>                for feat in layer.getFeatures():</div>
<div>                    a=str(feat['assessment_investigator_actor'])</div>
<div>                    if "[['" not in a and a!='NULL':</div>
<div>                        t=a.replace(a[0],"[['"+a[0]).replace("|","'], ['").replace(a[-1],a[-1]+"']]") </div>
<div>            layer.updateFeature(feat)        </div>
<div>        QgsProject.instance().removeMapLayer(<a href="http://layer.id" target="_blank" rel="noopener noreferrer">layer.id</a>())</div>
<div> </div>
<div>If I print the results it's ok but into table doesn't update.</div>
<div>Some one has some suggestions?</div>
<div> </div>
<div>Best<br />E</div>
<div> </div>
-- <br />
<div class="v1gmail_signature" dir="ltr">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">Enzo Cocca PhD</div>
<div dir="ltr">in "Science and Technology for Archaeology and Cultural Heritage"</div>
<div dir="ltr"> </div>
<div dir="ltr">
<div style="font: 400 13.33px/19.99px Arial,Helvetica,sans-serif; text-align: left; color: #222222; text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: visible; text-decoration: none; word-spacing: 0px; white-space: normal; background-color: transparent;">
<div style="font: 400 13.33px/19.99px Arial,Helvetica,sans-serif; overflow: visible;"><span style="font: 400 13.33px/19.99px Arial,Helvetica,sans-serif; overflow: visible;">ISMEO</span></div>
<div style="font: 400 13.33px/19.99px Arial,Helvetica,sans-serif; overflow: visible;">International Association of Mediterranean and Oriental Studies </div>
</div>
</div>
<div dir="ltr"><img style="font: 400 13.33px / 19.99px Arial, Helvetica, sans-serif; text-align: left; color: #000000; text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: visible; text-decoration: none; word-spacing: 0px; white-space: normal; background-color: transparent;" src="cid:162015185060918e2a01503775959078@geo.hu-berlin.de" width="200" height="75" /></div>
<div dir="ltr"><u></u><span style="text-decoration: line-through;"></span><br />
<div>mail: <a href="mailto:enzo.ccc@gmail.com" rel="noreferrer">enzo.ccc@gmail.com</a></div>
<div>cell: +393495087014</div>
<div> </div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br />
<div class="pre" style="margin: 0; padding: 0; font-family: monospace">_______________________________________________<br />QGIS-Developer mailing list<br /><a href="mailto:QGIS-Developer@lists.osgeo.org">QGIS-Developer@lists.osgeo.org</a><br />List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank" rel="noopener noreferrer">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br />Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank" rel="noopener noreferrer">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a></div>
</blockquote>
<p><br /></p>
<div id="signature">-- <br />
<div class="pre" style="margin: 0; padding: 0; font-family: monospace">--<br />Benjamin Jakimow, Doctoral Researcher<br />Earth Observation Lab | Geography Department | Humboldt-Universität zu Berlin<br /><br />e-mail: <a href="mailto:benjamin.jakimow@geo.hu-berlin.de">benjamin.jakimow@geo.hu-berlin.de</a><br /><br />phone:  +49 (0) 30 2093 6894<br />mobile: +49 (0) 157 5656 8477<br />fax:    +49 (0) 30 2093 6848<br />mail:   Unter den Linden 6 | 10099 Berlin | Germany<br />room: 2'222</div>
</div>
</body></html>