Answer the question
In order to leave comments, you need to log in
Checking if an object exists in a Django database?
there is a model:
class Music(models.Model):
artist_mane = models.CharField(max_length=50)
track_name = models.CharField(max_length=50)
url = models.CharField(max_length=200)
Answer the question
In order to leave comments, you need to log in
If you should not have duplicates in the database for these fields, use https://docs.djangoproject.com/en/1.9/ref/models/o...
If, in addition to this, you just want to create only what is not there:
https: //docs.djangoproject.com/en/1.9/ref/models/q...
If you want something that is not created, and the rest is updated:
https://docs.djangoproject.com/en/1.9/ref/models/ q...
ZY, One has only to take into account that there is no "magic" here, and to check the existence of objects, janga will get into the database.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question