[Qgis-user] Forms, realtions and foreign keys
Karl Magnus Jönsson
Karl-Magnus.Jonsson at kristianstad.se
Tue Jun 4 02:55:34 PDT 2019
Thanks. Works perfect. I missed the "initially deferred" in the FK.
Karl-Magnus
Från: Qgis-user [mailto:qgis-user-bounces at lists.osgeo.org] För Matthias Kuhn
Skickat: den 4 juni 2019 11:27
Till: qgis-user at lists.osgeo.org
Ämne: Re: [Qgis-user] Forms, realtions and foreign keys
Hello,
If you enable "evaluate default values server side" and "automatic transaction groups" and set the foreign key check in the database to initially deferred you'll get pretty much what you want :)
Hope that helps
Matthias
On 6/4/19 11:14 AM, Karl Magnus Jönsson wrote:
Hi list!
I have a project with tree tabels stored in PostGIS. One is holding the geometry the other two is holding data related to the first table as child and grandchild. I have set up foreign keys between the tables in the database to be sure that there will be no orphan records. In QGIS there are relations and (sub)forms. When I digitize a new geometry I get the new id from the database (before it's saved, OK) in the form but I can't add any children. I get a database error that says that there are no parent with that ID (and that's true). I have to press OK to create the feature in QGIS, change tool to identify, find the feature and klick on it to open the form again. Then I can add children. But I haven't saved so there is still no parent. But it works then. It's the same with the grandchild table but then the grandparent form is still open so it's not such a big problem. Anyone got a better way to skip this closing and reopening of the form in the workflow?
Karl-Magnus Jönsson | Gis-Utvecklare
Geografisk information
Miljö- och samhällsbyggnadsförvaltningen
Kristianstads kommun
Besöksadress: Västra Storgatan 12
Postadress: 291 80 KRISTIANSTAD
Telefon: 044-135416 | Mobil: 0733-135416
E-post: Karl-Magnus.Jonsson at kristianstad.se<mailto:Karl-Magnus.Jonsson at kristianstad.se>
www.kristianstad.se<http://www.kristianstad.se/>
Läs mer om hur vi hanterar dina personuppgifter på www.kristianstad.se/personuppgifter<http://www.kristianstad.se/personuppgifter>
_______________________________________________
Qgis-user mailing list
Qgis-user at lists.osgeo.org<mailto:Qgis-user at lists.osgeo.org>
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20190604/7fdd1b9d/attachment-0001.html>
More information about the Qgis-user
mailing list