Hello. I am stumbled over issue of correct assigning value to field with m2m relation.
So, in the essense I have such problem – how to convert in concise and clean way Queryset into list of ids of object from such Queryset
So, basic syntax I implemented now –
original_data['assignees'] = list(task.assignees.values_list('id', flat=True))[0],
looks very cumbersome and terrible.
Best option I discovered as of now it just do like this –
original_data['assignees'] = [worker1.id, worker2.id][0],
But it still looks strange and not good from my perspective.
So, could you please help me, how to do it in more clean and concise way?