Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to avoid inserting duplicate records in orm django

if not table.objects.filter(column1=values).exists():
    # Insert new data here
    table.objects.create(column1=v1, column2=v2)
Source by sqlerrors.com #
 
PREVIOUS NEXT
Tagged: #avoid #inserting #duplicate #records #orm #django
ADD COMMENT
Topic
Name
4+7 =