dabo Commit
Revision 4883
Date: 2008-12-21 14:48:46 -0800 (Sun, 21 Dec 2008)
Author: Paul
Trac: http://trac.dabodev.com/changeset/4883

Changed:
U   trunk/dabo/db/dCursorMixin.py

Log:
Got a step closer to fixing the problem where NonUpdateFields isn't 
automatically
set anymore for foreign fields. This workaround fills in '_foreign_field_' for 
the
table name in DataStructure. The better fix will be to get the actual foreign 
table name filled in, but this at least makes the NonUpdateFields work again, I 
believe.

I only found completed trac tickets referencing NonUpdateFields (#1151 and 
#1081)
so I guess this never got entered.


Diff:
Modified: trunk/dabo/db/dCursorMixin.py
===================================================================
--- trunk/dabo/db/dCursorMixin.py       2008-12-20 00:06:02 UTC (rev 4882)
+++ trunk/dabo/db/dCursorMixin.py       2008-12-21 22:48:46 UTC (rev 4883)
@@ -2303,13 +2303,18 @@
                                        pass
                                else:
                                        ds = 
self.BackendObject.getStructureDescription(self)
+                                       gf_names = [gf[0] for gf in 
self.getFields(self.Table)]
                                        for field in ds:
                                                field_name, field_type, pk = 
field[0], field[1], field[2]
                                                try:
                                                        field_scale = field[5]
                                                except IndexError:
                                                        field_scale = None
-                                               val.append((field_name, 
field_type, pk, self.Table, field_name, field_scale))
+                                               if field_name in gf_names:
+                                                       table_name = self.Table
+                                               else:
+                                                       table_name = 
"_foreign_table_"
+                                               val.append((field_name, 
field_type, pk, table_name, field_name, field_scale))
                                self._savedStructureDescription = val
                        self._dataStructure = val
                return tuple(val)




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to