Skip to content

Commit

Permalink
refactored dialogs.py v2
Browse files Browse the repository at this point in the history
  • Loading branch information
arohanajit committed Sep 25, 2024
1 parent 68c7245 commit 7c2b4bb
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions gui/wxpython/dbmgr/dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,13 @@ def GetSQLString(self, updateValues=False):
ctype = columns[name]["ctype"]
value = columns[name]["values"][idx]
id = columns[name]["ids"][idx]
try:
newvalue = self.FindWindowById(id).GetValue()
except:
newvalue = self.FindWindowById(id).GetLabel()
widget = self.FindWindowById(id)
if hasattr(widget, "GetValue"):
newvalue = widget.GetValue()
elif hasattr(widget, "GetLabel"):
newvalue = widget.GetLabel()
else:
raise AttributeError(f"AttributeError in {widget}")

if newvalue:
try:
Expand Down

0 comments on commit 7c2b4bb

Please sign in to comment.