[Qgis-user] Value relations in QGIS

Randal Hale rjhale at northrivergeographic.com
Fri Mar 17 08:42:16 PDT 2017


Question.

I'm working with a group and I'm attempting to "idiot proof" editing a 
bit - well - at least the attribution. I've set up a database 
(postgresql/postgis) and went so far as to set up foreign keys. I set up 
value relations and we now have drop down lists for about everything.

I decided to save what I am doing. I saved the data layer as a qlr. I 
saved the style as a qml. I re-added the data using the qlr and the 
style using the qml. EXCEPT - it didn't restore the value relations. 
They are in the qml file:

      <edittype widgetv2type="ValueRelation" name="confk">

       <widgetv2config OrderByValue="0" AllowNull="0" FilterExpression="" UseCompleter="0" fieldEditable="1" Key="id" constraint="" Layer="contractor_tbl20170317111848429" Value="contractor" labelOnTop="0" constraintDescription="" AllowMulti="0" notNull="0"/>

     </edittype>

the Layer -> contractor_tbl20170317111848429 isn't quite the right name 
but I'm assuming that's some internal QGIS layer naming. I even changed 
it - it wouldn't restore.

I did more digging and discovered the value relation is also in the qlr 
file - but it's not restoring the widgets either. Maybe it doesn't 
matter that I saved a qml.

Question is - should it restore? Or are value relations (widgets) just 
for that QGIS session - so I need to set this up 5 times for 5 people? 
Which I don't mind doing - I was under the impression this 
saved/restored with the qlr/qml.

QGIS: 2.18.4
OS: Ubuntu (mate) 16.04
QGIS repo/Ubuntu GIS repo.

Thanks

Randy



-- 
-----------------
Randal Hale
North River Geographic Systems, Inc
http://www.northrivergeographic.com
423.653.3611 rjhale at northrivergeographic.com
twitter:rjhale




More information about the Qgis-user mailing list