<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Dear all,</p>
    <p>As a learning experience I am trying to make an application that
      was developed with python 2 and qgis 2 with a postgres backend of
      vs 9.3 work with python 3/qgis 3/postgres 13.</p>
    <p>As expected, there are plenty of places where it is still not
      working as it should, but I have managed to upgrade the database,
      open the project file in qgis 3.16, and all the layers (based on
      views) have loaded correctly. The relationships that were stored
      in the project file also seem to be working correctly with the
      existing .ui files. I can open the parent layer form, and in the
      child form I can see the foreign key reflected properly, and
      changing as the selected parent feature is changed. All the
      relationship settings were set manually and stored in the project
      file. When I change the column preview on the left hand side of
      the form from parentid to any other column, the child form still
      shows the parentid correctly.</p>
    <p>For testing/learning purposed I did the whole process manually
      from scratch in 3.16. When I now open the parent layer form, and
      set the column preview on the left of the form to anything else
      than the parentid, in the child form, where I would have expected
      the parentid as before, it shows the column used in the column
      preview.</p>
    <p>Is this the expected behaviour? Is it possible to set this to the
      'old' behavior? If so, can that also be done using python
      (ultimately I want to load the layers and create the relationships
      in python)? Below some screenshots to clarify what I described.<br>
    </p>
    <p>Thanks for your help,</p>
    <p>Janneke</p>
    <p>Original situation (A), behaviour as expected:</p>
    <p>A) With locationid as column preview shows corresponding
      locationid in child form (the number 1)<br>
    </p>
    <p><img src="cid:part1.51133ECD.36B7640C@gmail.com" alt=""><img
        src="cid:part2.BC9F89D4.17F83979@gmail.com" alt=""></p>
    <p>The same when changing the column preview: (now locationid in
      child form is number 11288)<br>
    </p>
    <p></p>
    <p><img src="cid:part3.3C79F81C.1B434CAD@gmail.com" alt=""
        width="173" height="72"><img
        src="cid:part4.712463A3.06B127F4@gmail.com" alt="" width="292"
        height="70"></p>
    <p>B) Manually newly created relationships, with column preview of
      the parent id shows it in the child form (note that there seems to
      be a box in front of another box, in another situation I have seen
      it looking like a greyed out combo box)<br>
    </p>
    <p><img src="cid:part5.087ABD75.D1C8D1F5@gmail.com" alt=""><img
        src="cid:part6.947FB361.31BBE2B9@gmail.com" alt=""></p>
    <p></p>
    <p>With the newly created relationship, when selecting districtid as
      a column preview, it is the district id that is shown in the child
      form, not the locationid.<br>
    </p>
    <p><img src="cid:part7.9989E74F.6D3D6E7C@gmail.com" alt=""><img
        src="cid:part8.71877B4D.2BEA4328@gmail.com" alt=""></p>
    <br>
    <p><br>
    </p>
    <p><br>
    </p>
    <p><br>
    </p>
    <p><br>
    </p>
  </body>
</html>