Rather than unpacking a list of fields, I was attempting to unpack a tuple of fields, and pass the result into the db().select() function, as in the following:
def get_record(self, record_id, fields):
try:
return self.db(self.db.t_group.id == record_id).select(*fields).first()
except Exception as e:
print e
def fun1(self, record_id):
self.get_record(record_id, (self.db.t_group.f_expiration))
Doing so promptly gobbles up all of the system's memory, more or less bringing the system to a halt. If I had passed a list, instead of a tuple, however, as in the following statement, the function works as expected:
def fun1(self, record_id):
self.get_record(record_id, [self.db.t_group.f_expiration])
Why is it problematic to unpack a tuple into the db().select() function?