<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hi Giovanni<br>
</p>
<div class="moz-cite-prefix">On 04/17/2018 06:23 PM, Giovanni Manghi
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CACfnYnSde6zFYSWJt2Cb_H5qsxPmWkWrNVdRhmtueSVT8N+w-A@mail.gmail.com">
<div dir="ltr">
<div>
<div>Hi all,<br>
<br>
</div>
I have recently had to test some scenario with 1:n relations
in QGIS and I have found a few issues and would like to know
if someone has them in its pipeline/todo list, eventually to
share the effort for the fixes.<br>
<br>
</div>
<div>Anyway I'm also interested on your feedback on the matter.<br>
<br>
</div>
<div>1) 1:n relations in QGIS3. They seems unusable at the
moment. When opening a parent layer feature form, the
area/space where the child records should show does not
show/cannot be expanded.<br>
<br>
</div>
</div>
</blockquote>
Interesting, I cannot reproduce this here on Linux nor did I hear of
this from our clients using Windows.<br>
<br>
<blockquote type="cite"
cite="mid:CACfnYnSde6zFYSWJt2Cb_H5qsxPmWkWrNVdRhmtueSVT8N+w-A@mail.gmail.com">
<div dir="ltr">
<div><br>
</div>
<div>2) 1:n relations in QGIS 2.18.<br>
<br>
</div>
<div>I have tried a scenario (that to me seems not unusual at
all) where both the parent and the child are layers/tables
with a geometry.<br>
<br>
</div>
<div>The case where the child has its own geometries does not
seems well implemented (if implemented at all) in the context
of the relation feature form and this causes the following:<br>
<br>
</div>
<div>a) from within the parent feature form, if I edit the child
and try add a new record there is no tool to allow also
add/digitize the proper geometry. The user can still enter
only the attributes and when saving I have seen two things
happen *) In a test project using GPKGs this led effectively
to a record orphaned of its geometry *) In a test project
using PostGIS layers the edits are *silently* discarded, no
warning, no error, not even in QGIS logs.<br>
</div>
</div>
</blockquote>
<br>
From what I can remember, yes, there is still an issue here that the
geometry cannot be digitized right at this time. As a workaround one
can go to the attribute table and select this feature and use the
add part tool. In some project we implemented a python based feature
action that implements this use case. (Hint hint, if there's a
customer request for this, I'll be happy to estimate the required
amount of work ;) ).<br>
<br>
<blockquote type="cite"
cite="mid:CACfnYnSde6zFYSWJt2Cb_H5qsxPmWkWrNVdRhmtueSVT8N+w-A@mail.gmail.com">
<div dir="ltr">
<div><br>
</div>
<div>b) from within the parent feature form, when toggling
editing for the child, this is effectively put it in edit
state also in the layers panel. So a user can "move away" the
parent feature form (that it is on first plane) and use the
standard editing tools to add a geometry to the child layer.
When finished the attributes form pop-up and can be used to
fill the data, with the important issue/limitation that the
"referencing field" is *not* automatically filled as it is
done when working within the relation form. Once saved the new
record will also show in the relation form. This seems a
partial workaround because as said the referencing field is
not automatically filled.<br>
</div>
</div>
</blockquote>
<br>
Are you referring to the case here, when the parent is added (and
not edited)<br>
for this case you preferably<br>
* enable transaction mode<br>
* server side evaluation of default values (so the id of the parent
is known already at form time before the parent is committed to the
layer)<br>
* deferred foreign key constraints (so the database only checks if
the foreign key points to a valid parent at transaction commit time)<br>
<br>
I hope this helps at least a bit<br>
Matthias<br>
<br>
<blockquote type="cite"
cite="mid:CACfnYnSde6zFYSWJt2Cb_H5qsxPmWkWrNVdRhmtueSVT8N+w-A@mail.gmail.com">
<div dir="ltr">
<div><br>
</div>
<div>Am I missing something?<br>
<br>
</div>
<div>thanks in advance for your feedback.<br>
<br>
</div>
<div>cheers<br>
<br>
</div>
<div>-- Giovanni --<br>
<br>
<br>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
QGIS-Developer mailing list
<a class="moz-txt-link-abbreviated" href="mailto:QGIS-Developer@lists.osgeo.org">QGIS-Developer@lists.osgeo.org</a>
List info: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-developer">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a>
Unsubscribe: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-developer">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a></pre>
</blockquote>
<br>
<div class="moz-signature">-- <br>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<div class="moz-signature">
<title></title>
<div class="moz-signature"> <span style="text-align: left;
color: #000000; font-family: 'Verdana', sans-serif;
font-size: 10pt">Matthias Kuhn</span><br>
<a href="mailto:matthias@opengis.ch" target="_blank"> <span
style="text-align: left; color: #000000; font-family:
'Verdana', sans-serif; font-size: 8pt">matthias@opengis.ch</span>
</a><br>
<span style="text-align: left; color: #000000; font-family:
'Verdana', sans-serif; font-size: 8pt"><a
href="tel:+41764356763">+41 (0)76 435 67 63</a></span><br>
<div> <a href="http://www.opengis.ch"> <img
moz-do-not-send="false"
src="cid:part3.709E8806.D9E0FE13@opengis.ch"
alt="OPENGIS.ch Logo" height="80" width="200"></a> </div>
</div>
</div>
</div>
</body>
</html>