@@ -1007,13 +1007,8 @@ def requery(
1007
1007
1008
1008
rows = self .driver .execute (query )
1009
1009
self .rows = rows
1010
-
1010
+ print ( self . rows )
1011
1011
if len (self .rows .index ):
1012
- # # if "sort_order" not in self.rows.attrs:
1013
- # # Store the sort order as a dictionary in the attrs of the DataFrame
1014
- # sort_order = self.rows[self.pk_column].to_list()
1015
- # self.rows.attrs["sort_order"] = {self.pk_column: sort_order}
1016
-
1017
1012
# now we can restore the sort order
1018
1013
self .load_sort_settings (sort_settings )
1019
1014
self .sort (self .table )
@@ -1254,17 +1249,16 @@ def search(
1254
1249
1255
1250
# First lets make a search order.. TODO: remove this hard coded garbage
1256
1251
if len (self .rows .index ):
1257
- logger .debug (f"DEBUG: { self .search_order } { self .rows [0 ]. keys () } " )
1258
- for o in self .search_order :
1252
+ logger .debug (f"DEBUG: { self .search_order } { self .rows . columns [0 ]} " )
1253
+ for field in self .search_order :
1259
1254
# Perform a search for str, from the current position to the end and back by
1260
1255
# creating a list of all indexes
1261
1256
for i in list (range (self .current_index + 1 , len (self .rows .index ))) + list (
1262
1257
range (0 , self .current_index )
1263
1258
):
1264
1259
if (
1265
- o in self .rows [i ]
1266
- and self .rows [i ][o ]
1267
- and search_string .lower () in str (self .rows [i ][o ]).lower ()
1260
+ field in list (self .rows .columns )
1261
+ and search_string .lower () in str (self .rows .iloc [i ][field ]).lower ()
1268
1262
):
1269
1263
old_index = self .current_index
1270
1264
self .current_index = i
@@ -2336,15 +2330,9 @@ def insert_row(self, row: dict, idx: int = None) -> None:
2336
2330
if idx is None :
2337
2331
idx = len (self .rows .index )
2338
2332
idx_label = self .rows .index .max () if len (self .rows .index ) > 0 else 0
2339
- # self.rows.loc[idx_label] = row_series
2340
- # self.rows.attrs["sort_order"][self.pk_column].append(row[self.pk_column])
2341
2333
self .rows .attrs ["virtual" ].loc [idx_label ] = True
2342
2334
2343
2335
2344
- # self.rows.sort_index() (this wasn't doing anything,
2345
- # since it defaults to inplace=False)
2346
-
2347
-
2348
2336
class Form :
2349
2337
2350
2338
"""
0 commit comments