[Zope] Delete multiple posts

Tino Wildenhain tino@wildenhain.de
Tue, 03 Apr 2001 14:47:49 +0200


Hi Casey,

Casey Duncan wrote:
> 
> Gitte Wange wrote:
> 
> Thought I would jump in:
> 
> You do not need to explicitly iterate the list in dtml. You can simply
> pass the list whole to the ZSQL method and delete all the items in one
> SQL call. This will be much more efficient both in code and overhead.
> The ZSQL method would be something like:
> 
> Arguments:
>     ids:list
> 
> Code:
>     DELETE FROM mytable WHERE <dtml-sqltest name="ids" column="id"
> type="int" multiple>
> 
> If you pass is a list like [2,4,6,8] the resulting SQL will look like:
> 
> DELETE FROM mytable WHERE id in (2,4,6,8)
> 
Thats even better than my solution! :-) Used the special methods
very rarely so far ;)

Regards
Tino