[Zope] I read your tip about "Multiple Selections" but i need more details:
Richard Bendit
rbendit@netbooster.de
Wed, 25 Jul 2001 12:38:08 +0200
select ... where
col in ( <dtml-var "_.string.join(multiple_selection,',')"> )
Can you make a full example of this, PLEASE ?
Because i donīt know where to put this code !
Musi i put it all in a ZSQL-Method and if how will look this query:
Here my query:
select ap_selection from Projects where proj_id=<dtml-sqlvar proj_id
type=int>
Comment:
ap_selection is the coloumn where the selected values are stored like this:
[value1,value2,value3,...] (It is a MS SQL Server2000)
****************************************************************************
Can you have a this ?
****************************************************************************
<dtml-call "REQUEST.set('selectedAP',[])">
<dtml-in List_SelectedALIASPAGES>
<dtml-call "selectedAP.append(proj_id)">
</dtml-in>
<dtml-in List_ALIASPAGES2>
<input type=checkbox name=ap_selection:list value="<dtml-var
sequence-item>"
<dtml-call expr="REQUEST.set(selectedAP,_['sequence-item'])">
<dtml-in List_SelectedALIASPAGES>
<dtml-if expr="_['sequence-item'] == selectedAP">
checked
</dtml-if>>
</dtml-in>
<dtml-var sequence-item><br>
</dtml-in>
***************************************************************************
This ERROR comes:
Error Type: TypeError
Error Value: unhashable type
Traceback (innermost last):
File C:\PROGRA~1\ZBendit\lib\python\ZPublisher\Publish.py, line 222, in
publish_module
File C:\PROGRA~1\ZBendit\lib\python\ZPublisher\Publish.py, line 187, in
publish
File C:\PROGRA~1\ZBendit\lib\python\Zope\__init__.py, line 221, in
zpublisher_exception_hook
(Object: Traversable)
File C:\PROGRA~1\ZBendit\lib\python\ZPublisher\Publish.py, line 171, in
publish
File C:\PROGRA~1\ZBendit\lib\python\ZPublisher\mapply.py, line 160, in
mapply
(Object: ProjectsUpdateForm)
File C:\PROGRA~1\ZBendit\lib\python\ZPublisher\Publish.py, line 112, in
call_object
(Object: ProjectsUpdateForm)
File C:\PROGRA~1\ZBendit\lib\python\OFS\DTMLDocument.py, line 177, in
__call__
(Object: ProjectsUpdateForm)
File C:\PROGRA~1\ZBendit\lib\python\DocumentTemplate\DT_String.py, line
528, in __call__
(Object: ProjectsUpdateForm)
File C:\PROGRA~1\ZBendit\lib\python\DocumentTemplate\DT_In.py, line 691,
in renderwob
(Object: ProjectsPkSelectMethod)
File C:\PROGRA~1\ZBendit\lib\python\DocumentTemplate\DT_In.py, line 691,
in renderwob
(Object: List_ALIASPAGES2)
File C:\PROGRA~1\ZBendit\lib\python\DocumentTemplate\DT_Util.py, line 337,
in eval
(Object: REQUEST.set(selectedAP,_['sequence-item']))
(Info: REQUEST)
File <string>, line 0, in ?
File C:\PROGRA~1\ZBendit\lib\python\ZPublisher\BaseRequest.py, line 161,
in __setitem__
TypeError: (see above)
THANX and Regards
Richard