Answers for "delete duplicates django"

8

remove duplicates python

mylist = ["a", "b", "a", "c", "c"]
mylist = list(dict.fromkeys(mylist))
Posted by: Guest on May-26-2020
0

django prevent duplicate entries

for instance in Stock.objects.all():
			if instance.category == category:
				raise forms.ValidationError(str(category) + ' is already created')
		return category
Posted by: Guest on February-02-2021

Python Answers by Framework

Browse Popular Code Answers by Language