<div dir="ltr">Now I've got another problem, the <span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px;white-space:pre">committedAttributeValuesChanges </span>and <span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px;white-space:pre">committedGeometriesChanges </span>signals of <span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px;white-space:pre">QgsVectorLayer </span>don't seem to fire when I change attributes or geometries...<div>I'm not sure if I'm hitting a bug or if there's something else I don't understand, but this time the problem doesnt come from views (it appears also on normal tables).</div><div><br></div><div>Here's my test case (to be run in the python console, with a vector layer selected) :</div><div><br></div><div><pre class="" style="margin-top:0px;margin-bottom:0px;width:748px"><blockquote style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex" class="gmail_quote">
def testFeaturesAdded(a, b):
        QgsMessageLog.logMessage( 'committedFeaturesAdded was triggered' )

def testFeaturesRemoved(a, b):
        QgsMessageLog.logMessage( 'committedFeaturesRemoved was triggered' )

def testAttributeValuesChanges(a, b):
        QgsMessageLog.logMessage( 'committedAttributeValuesChanges was triggered' )

def testGeometriesChanges(a, b):
        QgsMessageLog.logMessage( 'committedGeometriesChanges was triggered' )

iface.activeLayer().committedFeaturesAdded.connect( testFeaturesAdded )
iface.activeLayer().committedFeaturesRemoved.connect( testFeaturesRemoved )
iface.activeLayer().committedAttributeValuesChanges.connect( testAttributeValuesChanges )
iface.activeLayer().committedGeometriesChanges.connect( testGeometriesChanges )</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"> </blockquote><div><br></div><div class="" id="file-bug-LC16" style="color:rgb(51,51,51);font-size:12px;line-height:16.7999992370605px"><font face="arial, helvetica, sans-serif"><br></font></div><font face="arial, helvetica, sans-serif">I get messages on committed creation and deletion of features, but not on modifications...</font></pre><pre class="" style="margin-top:0px;margin-bottom:0px;width:748px"><font face="arial, helvetica, sans-serif">Is it a bug ? If someone confirms, I'll file a ticket... (I tested under master and 2.8.1)</font><br></pre><pre class="" style="margin-top:0px;margin-bottom:0px;width:748px"><font face="arial, helvetica, sans-serif"><br></font></pre><pre class="" style="margin-top:0px;margin-bottom:0px;width:748px"><font face="arial, helvetica, sans-serif">Best regards,</font></pre><pre class="" style="margin-top:0px;margin-bottom:0px;width:748px"><font face="arial, helvetica, sans-serif"><br></font></pre><pre class="" style="margin-top:0px;margin-bottom:0px;width:748px"><font face="arial, helvetica, sans-serif">Olivier</font></pre><pre class="" style="margin-top:0px;margin-bottom:0px;width:748px"><br></pre><pre class="" style="margin-top:0px;margin-bottom:0px;width:748px"><br></pre></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-03-19 1:09 GMT+01:00 Olivier Dalang <span dir="ltr"><<a href="mailto:olivier.dalang@gmail.com" target="_blank">olivier.dalang@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><p>Jürgen,</p><p>I've been able to solve my problem by adding a default value on my view (and by also forwarding the ID in the insert trigger) :<br></p><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><font face="monospace, monospace">ALTER VIEW test_view ALTER COLUMN id SET DEFAULT nextval('test_id_seq');</font></blockquote><div><br></div><div>I updated the gist just in case : <a href="https://gist.github.com/olivierdalang/cad70df2d463d0b87566" style="font-size:12.8000001907349px" target="_blank">https://gist.github.com/olivierdalang/cad70df2d463d0b87566</a> </div><p>Thank you very much for your help :)</p><span class="HOEnZb"><font color="#888888"><p>Olivier</p><p dir="ltr"><br></p><p dir="ltr"><br></p>
</font></span><div class="gmail_quote"><div><div class="h5">On Mar 18, 2015 7:17 PM, "Jürgen E." <<a href="mailto:jef@norbit.de" target="_blank">jef@norbit.de</a>> wrote:<br type="attribution"></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div class="h5">Hi Olivier,<br>
<br>
On Wed, 18. Mar 2015 at 18:40:20 +0100, Olivier Dalang wrote:<br>
> Am I doing something wrong ?<br>
<br>
Not really - just something that isn't expected.<br>
<br>
> Or is QGIS using some other way to get back the ID of a new feature ? Any<br>
> idea of what that could be ?<br>
<br>
It retrieves the default values for all attributes (which might be a call to<br>
nextval), executes them and uses the result for the insert.  So it knows<br>
the id before the insert and can update the feature with it.<br>
<br>
<br>
Jürgen<br>
<br>
--<br>
Jürgen E. Fischer           norBIT GmbH             Tel. <a href="tel:%2B49-4931-918175-31" value="+49493191817531" target="_blank">+49-4931-918175-31</a><br>
Dipl.-Inf. (FH)             Rheinstraße 13          Fax. <a href="tel:%2B49-4931-918175-50" value="+49493191817550" target="_blank">+49-4931-918175-50</a><br>
Software Engineer           D-26506 Norden             <a href="http://www.norbit.de" target="_blank">http://www.norbit.de</a><br>
QGIS release manager (PSC)  Germany                    IRC: jef on FreeNode<br>
<br></div></div><span class="">_______________________________________________<br>
Qgis-developer mailing list<br>
<a href="mailto:Qgis-developer@lists.osgeo.org" target="_blank">Qgis-developer@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br></span></blockquote></div>
</div>
</blockquote></div><br></div>