Skip to content

Commit 97e3686

Browse files
committed
refs #281, getting a start on converting over to Pandas for ResultSets
more conversions
1 parent e9e9190 commit 97e3686

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

pysimplesql/pysimplesql.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -1378,8 +1378,9 @@ def get_current(
13781378
:returns: The value of the column requested
13791379
"""
13801380
logger.debug(f"Getting current record for {self.table}.{column}")
1381-
if self.rows:
1381+
if len(self.rows.index):
13821382
if self.get_current_row()[column]:
1383+
print("Current: ", self.get_current_row()[column])
13831384
return self.get_current_row()[column]
13841385
return default
13851386
return default
@@ -1980,7 +1981,7 @@ def table_values(
19801981

19811982
values = []
19821983
try:
1983-
all_columns = self.rows[0].keys()
1984+
all_columns = list(self.rows.columns)
19841985
except IndexError:
19851986
all_columns = []
19861987

@@ -3186,7 +3187,9 @@ def update_elements(
31863187
# Populate the combobox entries
31873188
else:
31883189
lst = []
3189-
for row in target_table.rows:
3190+
print(type(target_table), target_table)
3191+
for index, row in target_table.rows.iterrows():
3192+
print(row)
31903193
print(
31913194
row,
31923195
pk_column,
@@ -3198,7 +3201,7 @@ def update_elements(
31983201

31993202
# Map the value to the combobox, by getting the description_column
32003203
# and using it to set the value
3201-
for row in target_table.rows:
3204+
for index, row in target_table.rows.iterrows():
32023205
if row[target_table.pk_column] == mapped.dataset[rel.fk_column]:
32033206
for entry in lst:
32043207
if entry.get_pk() == mapped.dataset[rel.fk_column]:

0 commit comments

Comments
 (0)