[gnue-contrib] r286 - address/forms

[email protected]
Newsgroups gmane.comp.cms.gnue.cvs
Message-ID <[email protected]>
Author: johannes
Date: 2008-07-29 04:10:14 -0500 (Tue, 29 Jul 2008)
New Revision: 286

Modified:
   address/forms/address.gfd
Log:
Optimierung der Performance


Modified: address/forms/address.gfd
===================================================================
--- address/forms/address.gfd	2008-07-29 08:44:27 UTC (rev 285)
+++ address/forms/address.gfd	2008-07-29 09:10:14 UTC (rev 286)
@@ -370,7 +370,6 @@
    blk_csv.set_filter()
    from gnue.common.utils import ucsv
    fieldnames = [
-           u"FID",
            u"FA/Firma1",
            u"FA/Firma2",
            u"FA/Straße",
@@ -395,16 +394,21 @@
            u"ASP/Filter3"]
 
    master = blk_company.get_data(['id'])
-   detail = blk_csv.get_data(fieldnames)
+   flist = ['FID']
+   flist.extend(fieldnames)
+   detail = blk_csv.get_data(flist)
 
+   dmap = {}
+   for row in detail:
+       dmap[int(row['FID'])] = row
+
    neu = []
    for row in master:
        mid = int(row['id'])
 
-       # haben wir ein Detail
-       for drow in detail:
-           if int(drow['FID']) == mid:
-               neu.append(drow)
+       drow = dmap.get(mid)
+       if drow:
+           neu.append(drow)
 
    ucsv.write_file(fieldnames, neu, fname,
            dialect="excel-tab", encoding="cp1250")
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.