Get a query_set and
Due to duplicate values in hoge column,
I would like to eliminate duplicates.
I'd like to write this in a list format. How should I write it?
want_list=[]
pass_hoge_list = [ ]
for i in list(query_set):
if not i.get(hoge) in pass_hoge_list:
pass_hoge_list.append(i.get('hoge')))
want_list.append(i)
{i.get("hoge"):i for i in query_set}.values()
Is it like this?
© 2024 OneMinuteCode. All rights reserved.