<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-text-html" lang="x-unicode">
      <p><br>
      </p>
      <div class="moz-cite-prefix">Il 04/05/19 14:36, Carlos Catucci ha
        scritto:<br>
      </div>
      <blockquote type="cite"
cite="mid:CAEaPG9RP=T8f=WS23Zux7YZqaQ97PVLzhyrVD5uhukQ6WRxsGA@mail.gmail.com">
        <div dir="ltr">
          <div dir="ltr">
            <div class="gmail_default" style="font-size:small"><br>
            </div>
          </div>
          <br>
          <div class="gmail_quote">
            <div dir="ltr" class="gmail_attr">On Sat, 4 May 2019 at
              12:15, Francesco Bonanno <<a
                href="mailto:fgthct@gmail.com">fgthct@gmail.com</a>>
              wrote:<br>
            </div>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px
              0.8ex;border-left:1px solid
              rgb(204,204,204);padding-left:1ex">
              <div bgcolor="#FFFFFF">
                <p>Ciao, credo che questa bad practice funzioni fino
                  alla versione 1.11 dopodiché mancherebbe qualcosa
                  nelle dichiarazione dei ForeignKey ...e poi, perchè
                  vuoi reinventare la ruota?</p>
              </div>
            </blockquote>
            <div><span class="gmail_default" style="font-size:small">COn
                ala 2.21 il tutto funziona, ho solo dovuto aggiungere il
                paarametro on_delete=models.CASCADE </span> <span
                class="gmail_default" style="font-size:small">al
                ForeignKey.</span></div>
            <div><span class="gmail_default" style="font-size:small"><br>
              </span></div>
          </div>
        </div>
      </blockquote>
      Bene!<br>
      <blockquote type="cite"
cite="mid:CAEaPG9RP=T8f=WS23Zux7YZqaQ97PVLzhyrVD5uhukQ6WRxsGA@mail.gmail.com">
        <div dir="ltr">
          <div class="gmail_quote">
            <div><span class="gmail_default" style="font-size:small">Non
                reinvento la ruota, mi semplifico la vita. Metto la
                definizione delle funzioni in un file che importo nelle
                views e poi posso chiamare senza doverne definire una
                per ciascuna tabella.</span></div>
            <div><span class="gmail_default" style="font-size:small"><br>
              </span></div>
            <div><span class="gmail_default" style="font-size:small">Per
                capirci, creo una serie di funzioni</span></div>
            <div><span class="gmail_default" style="font-size:small"><br>
              </span></div>
            <div>
              <div class="gmail_default" style="font-size:small">def
                insert_update( table, data ):</div>
              <div class="gmail_default" style="font-size:small">    #
                Inserisce o aggiorna il record</div>
              <div class="gmail_default" style="font-size:small"><br>
              </div>
              <div class="gmail_default" style="font-size:small">def
                delete( table, id ):</div>
              <div class="gmail_default" style="font-size:small">    #
                Cancella il record indicato</div>
              <div class="gmail_default" style="font-size:small"><br>
              </div>
              <div class="gmail_default" style="font-size:small">def
                get_element( table, id ):</div>
              <div class="gmail_default" style="font-size:small">    #
                get elemento specified by pk</div>
              <div class="gmail_default" style="font-size:small"><br>
              </div>
              <div class="gmail_default" style="font-size:small">def
                get_filtered_element ( table, filters ):</div>
              <div class="gmail_default" style="font-size:small">    #
                get all records that match the filter, il filter is
                blank is the same of all()</div>
            </div>
          </div>
        </div>
      </blockquote>
      Posta un test per queste funzioni, sarebbe interessante<br>
      <blockquote type="cite"
cite="mid:CAEaPG9RP=T8f=WS23Zux7YZqaQ97PVLzhyrVD5uhukQ6WRxsGA@mail.gmail.com">
        <div dir="ltr">
          <div class="gmail_quote">
            <div>
              <div class="gmail_default" style="font-size:small"><br>
              </div>
              <div class="gmail_default" style="font-size:small">e poi
                dove mi serve di fare queste operazioni le invoco con i
                paramrtri relativi.</div>
              <div class="gmail_default" style="font-size:small"><br>
              </div>
            </div>
          </div>
        </div>
      </blockquote>
      Bada bene Carlos, la mia non era una polemica. Ritenevo solo il
      tuo interessante post più adatto ad una lista più appropriata<br>
      <br>
      <blockquote type="cite"
cite="mid:CAEaPG9RP=T8f=WS23Zux7YZqaQ97PVLzhyrVD5uhukQ6WRxsGA@mail.gmail.com">
        <div dir="ltr">
          <div class="gmail_quote">
            <div>
              <div class="gmail_default" style="font-size:small">So che
                si potrebbe ottenere lo stesso usando ContentType ma
                risulta piu' elaborato come metodo.</div>
              <div class="gmail_default" style="font-size:small"><br>
              </div>
            </div>
          </div>
        </div>
      </blockquote>
      <p>Te lo stavo per suggerire</p>
      <p>Un caro saluto, Franky<br>
      </p>
      <blockquote type="cite"
cite="mid:CAEaPG9RP=T8f=WS23Zux7YZqaQ97PVLzhyrVD5uhukQ6WRxsGA@mail.gmail.com">
        <div dir="ltr">
          <div class="gmail_quote">
            <div>
              <div class="gmail_default" style="font-size:small">Carlos</div>
            </div>
          </div>
          -- <br>
          <div dir="ltr" class="gmail_signature">
            <div dir="ltr">
              <div>
                <div dir="ltr">EZLN ... Para Todos Todo ... Nada para
                  nosotros<br>
                </div>
              </div>
            </div>
          </div>
        </div>
        <br>
        <fieldset class="mimeAttachmentHeader"></fieldset>
        <pre class="moz-quote-pre" wrap="">_______________________________________________
Python mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Python@lists.python.it">Python@lists.python.it</a>
<a class="moz-txt-link-freetext" href="https://lists.python.it/mailman/listinfo/python">https://lists.python.it/mailman/listinfo/python</a>
</pre>
      </blockquote>
    </div>
  </body>
</html>