Answers for "remove all duplicates but keep only one with remove duplicates function django"

3

remove duplicates function python

def remove_dupiclates(list_):
	new_list = []
	for a in list_:
    	if a not in new_list:
        	new_list.append(a)
	return new_list
Posted by: Guest on September-22-2020
0

removing duplicates from django models data

for duplicates in Tag.objects.values("name").annotate(
    records=Count("name")
).filter(records__gt=1):
    for tag in Tag.objects.filter(name=duplicates["name"])[1:]:
        tag.delete()
Posted by: Guest on January-31-2022

Code answers related to "remove all duplicates but keep only one with remove duplicates function django"

Python Answers by Framework

Browse Popular Code Answers by Language