Trying to iterate through numbers in a table rather than displayng all the values for each number in each cell
I am currently attempting to make a table which takes the lab number for a sample and returns the 'Value 2' of that number(I know it's a bad name but it's what I'm being made to work with) so far I can retrieve the data when a specific lab number is searched for, however if I just have a list of lab numbers in the table, it either displays as 'None' or it starts listing every lab number in order in each cell, as a dictionary.
The code that isn't displaying the data properly:
def GetValue2(self, _pageOfWorkflowCases):
_resultsDict = {}
for row in _pageOfWorkflowCases:
LabNumber = row['LABNO']
with connection.cursor() as _cursor:
_cursor.execute("{CALL dbo.uspShireXGetValue2(%s)}", [LabNumber])
_results = self.utilities.ConvertCursorListToDict(_cursor)
if _results:
_resultsDict[LabNumber] = _results.get['VALUE2']
return _resultsDict
The code that displays a lab number when it's searched for:
def GetValue2(self, _LabNumber):
with connection.cursor() as _cursor:
_cursor.execute("{CALL dbo.uspShireXGetValue2(%s)}", [_LabNumber])
_results = self.utilities.ConvertCursorListToDict(_cursor)
if _results:
_results = self.utilities.ConvertCursorListToDict(_cursor)
return _results