[gnue-contrib] r284 - address/forms

[email protected]
Newsgroups gmane.comp.cms.gnue.cvs
Message-ID <[email protected]>
Author: johannes
Date: 2007-11-08 02:09:34 -0600 (Thu, 08 Nov 2007)
New Revision: 284

Modified:
   address/forms/address.gfd
Log:
Add a fix for deleting the detail records


Modified: address/forms/address.gfd
===================================================================
--- address/forms/address.gfd	2007-11-07 15:27:04 UTC (rev 283)
+++ address/forms/address.gfd	2007-11-08 08:09:34 UTC (rev 284)
@@ -95,11 +95,12 @@
       </trigger>
 
       <trigger type="PRE-DELETE">
-        blk_contact.first_record()
-
-        while blk_contact.get_record_status() != 'empty':
-            blk_contact.delete_record()
-            blk_contact.next_record()
+        # TODO: This should be solved using the already existing blocks
+        backend = globals().get('address')
+        if backend is not None:
+            cid = blk_company.id.value
+            cmd = 'DELETE FROM contact WHERE company=%d' % cid
+            backend.sql(cmd);
       </trigger>
     </block>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.