Currently i have this
def convert_tuple(self, listobj, fields=None):
return [(obj.start, obj.end) for obj in listobj]
But i have hard coded the fields.
I want to have fields as another list like
def convert_tuple(self, listobj, fields=['start', 'end', 'user']):
return [(obj.field) for obj in listobj for field in fields]
How can i implement that
Expected output
[('2am', '5am', 'john'), ('3am', '5am', 'john1'), ('3am', '5am', 'john2') ]
where 2am is start , 5am is end , john is username