[GRASS-SVN] r32177 - grass/branches/develbranch_6/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Jul 19 19:28:50 EDT 2008


Author: martinl
Date: 2008-07-19 19:28:50 -0400 (Sat, 19 Jul 2008)
New Revision: 32177

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/dbm.py
Log:
wxGUI/dbm: fix trac #227 (column names uppercase, v.db.connect returns key column name lowercase)
[merged from trunk, r32176]


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/dbm.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/dbm.py	2008-07-19 23:24:28 UTC (rev 32176)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/dbm.py	2008-07-19 23:28:50 UTC (rev 32177)
@@ -2872,7 +2872,7 @@
                     type  = columns[name]['type']
                     value = columns[name]['values'][idx]
                     id    = columns[name]['ids'][idx]
-                    if name.lower() != key:
+                    if name != key:
                         self.FindWindowById(id).SetValue(str(value))
 
     def OnCancel(self, event):
@@ -2992,7 +2992,7 @@
                     else:
                         value = ''
 
-                    if name.lower() == key:
+                    if name == key:
                         box    = wx.StaticBox (parent=panel, id=wx.ID_ANY,
                                                label=" %s %s " % (_("Category"), value))
                         boxFont = self.GetFont()
@@ -3121,6 +3121,14 @@
             else:
                 return False
 
+            # check for key column
+            # v.db.connect -g/p returns always key column name lowercase
+            if self.layers[layer]["key"] not in columns.keys():
+                for col in columns.keys():
+                    if col.lower() == self.layers[layer]["key"]:
+                        self.layers[layer]["key"] = col.upper()
+                        break
+            
             self.tables[table] = columns
 
         return True



More information about the grass-commit mailing list