Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

django prevent duplicate entries

for instance in Stock.objects.all():
			if instance.category == category:
				raise forms.ValidationError(str(category) + ' is already created')
		return category
Source by arbcoms.com #
 
PREVIOUS NEXT
Tagged: #django #prevent #duplicate #entries
ADD COMMENT
Topic
Name
8+4 =