[Zope-it] Re: Problemi con SQLgroup

spinwing@inwind.it spinwing@inwind.it
Wed, 14 Mar 2001 20:24:16 +0100


Ciao Michele

no, io ho avuto esattamente gli stessi problemi, ed ho postato un messaggio sulla ML americana, ma non mi si =E8 filato nessuno... SInceramente ho risolto con <dtml-if>, riservandomi di riprovarci in seguito.

Ciao
Stefano Vedovelli

--__--__--

Message: 1
From: Zanotti Michele <Zanotti@az.aziendasanitaria.trentino.it>
To: zope-it@zope.org
Date: Mon, 12 Mar 2001 18:37:53 +0100
Subject: [Zope-it] Problemi con SQLgroup

Ciao a tutta la ml,
Una segnalazione ed una domanda.
La segnalazione (se =3DE8 gia stata fatta in Zope-it scusate tanto, ma mi =3D
=3DE8
sembrato che gli autori abbiano inviato l'annuncio solo sulla ml =3D
inglese di
Zope) =3DE8 per il prodotto di WorkFlow OpenFlow, informazioni su
http://sourceforge.net/projects/openflow . Anche se io sono solo un =3D
utente
inesperto mi sembra valga la pena darci uno sguardo- se si =3DE8 =3D
interessati al
workflow.

Passo alla domanda. Nel capitolo 10 dello Zope Book "Creating complex
queries with the Sqlgroup tag" si legge (se non erro) che dal template
select * from employees=3D20
        <dtml-sqlgroup where>
          <dtml-sqltest salary op=3D3Dgt type=3D3Dfloat optional>
        <dtml-and>
          <dtml-sqltest first op=3D3Deq type=3D3Dstring multiple optional>
        <dtml-and>
          <dtml-sqltest last  op=3D3Deq type=3D3Dstring multiple optional>
        </dtml-sqlgroup> =3D20
Posso ottenere le query
        select * from employees
        where(
          salary > 100000.00
        )
       =3D20
        select * from employees=3D20
        where(
          salary > 100000.00
          and
          first in ('Jane', 'Cheetah', 'Guido')   =3D20
        )
       =3D20
        select * from employees=3D20
        where(
          first =3D3D 'Old'
          and
          last =3D3D 'McDonald'    =3D20
        ).

Io ho provato a creare un database Gadfly simile a quello dell'esempio, =3D
e ad
eseguire l'esempio creando un SQLmethod in cui ho messo:
- il template in questione nel campo query-template=3D20
- i parametri salary  first e last (il primo numerico, gli altri =3D
carattere)
nel campo parametri.=3D20
Eseguendo il test del metodo ed assegnando un solo valore al campo =3D
salary,
il risultato =3DE8 stato (in accordo a quanto mi aspetterei leggendo il =3D
ZQR):
"There was no data matching this sqlMth_provaGadfly query.=3D20
SQL used:
select * from employees
where
(salary > 10000
 and first =3D3D ''
 and last =3D3D ''
)".

Ma dal libro mi aspettavo di ottenere la query:
select * from employees
where
(salary > 10000)

Sono io che non ho letto/eseguito l'esempio attentamente?.
Grazie in anticipo e ciao=3D20
Michele