I was wondering what the correct way is to save a number in Django SQLite coming from a Kraken API, when there is an Array of Array of strings or integers (
The SQLite response is actually saving the API number in the database:
I researched and tried thoroughly many similar cases here, but none had the example of an API response with this error message.
CodePudding user response:
I think the issue is the with the last item in the "result" array of arrays - "last". It seems like it's just a number. I guess you need some type checking in the algorithm.
Suggestion for code modification:
for i in data['result'].values():
# Skips "last" attribute
if isinstance(i, int):
continue
kraken_data = Krak(
time_0=(i[0][0]),
)
kraken_data.save()