<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Hi Luca<br>
    <br>
    Would this core functionality of QGIS be an option for you?<br>
    <br>
<a class="moz-txt-link-freetext" href="https://www.qgis.org/en/site/forusers/visualchangelog210/index.html#feature-filter-chaining-for-relation-reference-widget">https://www.qgis.org/en/site/forusers/visualchangelog210/index.html#feature-filter-chaining-for-relation-reference-widget</a><br>
    <br>
    If you are still required to use python in your forms: are you using
    global variables? They can be an issue for embedded forms.<br>
    <br>
    Cheers,<br>
    Matthias<br>
    <br>
    <div class="moz-cite-prefix">On 10/02/2015 09:09 AM, Luca Lanteri
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAM_TN38uzpZjCD0Q5eVJPk5ZDYpQ_DN35Br=nsRLONi2ERe67w@mail.gmail.com"
      type="cite">
      <div dir="ltr">Sadly, after further test I discover that the
        crashes remain, so I think it is a qgis bug and not a problem in
        my code.
        <div>The problem happens when I put my custom form into a
          subform widget (QgsRelationEditorWidget). If I add a new
          record in the subform and I move to another record using the
          left column QGIS crashes. It seems to be a more general
          problem because the crash appears also when I add some simple
          control that modify the object in the form.</div>
        <div><br>
        </div>
        <div>I can open a ticket and add some test data.</div>
        <div>If it is a minor bug and it could be resolved easily I
          really offer a pizza and a beer to resolve it.</div>
        <div><br>
        </div>
        <div>All the best</div>
        <div>Luca</div>
        <div><br>
        </div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">2015-10-01 23:53 GMT+02:00 Luca Lanteri
          <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:mescal72@gmail.com" target="_blank">mescal72@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">
              <div>
                <div>
                  <div>Hi,<br>
                    <br>
                  </div>
                  now I'm already using the python logic but my code is
                  terrible and I have a lot of crash problem.<br>
                </div>
                <div>Now that I using your example all is easier and
                  seem to worsk fine.<br>
                  <br>
                </div>
                <div>I owe you one beer.<br>
                  Many many tanks !<span class="HOEnZb"><font
                      color="#888888"><br>
                    </font></span></div>
                <span class="HOEnZb"><font color="#888888">
                    <div><br>
                    </div>
                    <div>Luca<br>
                      <br>
                    </div>
                  </font></span></div>
            </div>
            <div class="HOEnZb">
              <div class="h5">
                <div class="gmail_extra"><br>
                  <div class="gmail_quote">2015-10-01 22:23 GMT+02:00
                    Blumentrath, Stefan <span dir="ltr"><<a
                        moz-do-not-send="true"
                        href="mailto:Stefan.Blumentrath@nina.no"
                        target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:Stefan.Blumentrath@nina.no">Stefan.Blumentrath@nina.no</a></a>></span>:<br>
                    <blockquote class="gmail_quote" style="margin:0 0 0
                      .8ex;border-left:1px #ccc solid;padding-left:1ex">
                      <div link="#0563C1" vlink="#954F72" lang="NO-BOK">
                        <div>
                          <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"
                              lang="EN-US">Hi Luca,</span></p>
                          <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"
                              lang="EN-US"> </span></p>
                          <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"
                              lang="EN-US">Sounds like a case for Python
                              logic!</span></p>
                          <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"
                              lang="EN-US">General principles are
                              explained here:</span></p>
                          <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"
                              lang="EN-US"><a moz-do-not-send="true"
href="http://nathanw.net/2011/09/05/qgis-tips-custom-feature-forms-with-python-logic/"
                                target="_blank">http://nathanw.net/2011/09/05/qgis-tips-custom-feature-forms-with-python-logic/</a></span></p>
                          <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"
                              lang="EN-US"> </span></p>
                          <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"
                              lang="EN-US">Also nice, and probably
                              exactly what you are looking for:</span></p>
                          <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"
                              lang="EN-US"><a moz-do-not-send="true"
                                href="http://medspx.fr/blog/Qgis/cascade_forms/"
                                target="_blank">http://medspx.fr/blog/Qgis/cascade_forms/</a></span></p>
                          <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"
                              lang="EN-US"> </span></p>
                          <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"
                              lang="EN-US">Cheers</span></p>
                          <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"
                              lang="EN-US">Stefan</span></p>
                          <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"
                              lang="EN-US"> </span></p>
                          <p class="MsoNormal"><b><span
                                style="font-size:11.0pt;font-family:"Calibri",sans-serif"
                                lang="EN-US">From:</span></b><span
                              style="font-size:11.0pt;font-family:"Calibri",sans-serif"
                              lang="EN-US"> <a moz-do-not-send="true"
                                href="mailto:qgis-user-bounces@lists.osgeo.org"
                                target="_blank">qgis-user-bounces@lists.osgeo.org</a>
                              [mailto:<a moz-do-not-send="true"
                                href="mailto:qgis-user-bounces@lists.osgeo.org"
                                target="_blank">qgis-user-bounces@lists.osgeo.org</a>]
                              <b>On Behalf Of </b>Luca Lanteri<br>
                              <b>Sent:</b> 1. oktober 2015 22:07<br>
                              <b>To:</b> qgis-user <<a
                                moz-do-not-send="true"
                                href="mailto:Qgis-user@lists.osgeo.org"
                                target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a></a>><br>
                              <b>Subject:</b> [Qgis-user] QGIS - value
                              relation widget</span></p>
                          <div>
                            <div>
                              <p class="MsoNormal"> </p>
                              <div>
                                <div>
                                  <p class="MsoNormal">Hi to all,<br>
                                    <br>
                                    I need to build a form when the
                                    value of a combo are filtered basing
                                    on the value of anoter combobox.
                                    <br>
                                    I have a first combo where I choose
                                    the region and a second with the
                                    municipalities.
                                    <br>
                                    I need that the second combo shows
                                    only the municipalities of the
                                    choosed region.<br>
                                    I tried to use use the widget
                                    "relationship value" with the a
                                    filter like classe_munic =
                                    attribute($currentfeature,
                                    'classe_munic') without any success.
                                    <br>
                                    <br>
                                    Has anyone ever done something
                                    similar?<br>
                                    Thank in advance </p>
                                </div>
                                <p class="MsoNormal"
                                  style="margin-bottom:12.0pt"><br>
                                  Luca</p>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </blockquote>
                  </div>
                  <br>
                </div>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Qgis-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/qgis-user">http://lists.osgeo.org/mailman/listinfo/qgis-user</a></pre>
    </blockquote>
    <br>
  </body>
</html>