I have this model:
class Artist(models.Model):
name = models.CharField(max_length=50)
pseudo = models.CharField(max_length=50)
birth_date = models.DateField()
country = models.CharField(max_length=50)
instruments = models.CharField(max_length=50)
genre = models.CharField()
active = models.DateField()
labels = models.CharField(max_length=255)
website = models.URLField()
but some fields are optional (pseudo, instruments). How to solve the problem of optionality of the fields? I can add blank=True to this fields:
class Artist(models.Model):
name = models.CharField(max_length=50)
pseudo = models.CharField(max_length=50, blank=True)
birth_date = models.DateField()
country = models.CharField(max_length=50)
instruments = models.CharField(max_length=50, blank=True)
genre = models.CharField()
active = models.DateField()
labels = models.CharField(max_length=255)
website = models.URLField()
and do not enter data, but maybe you know a better solution?
OneToOneFieldif you don't like blank fields (but do like added complexity and overhead) – Jesse the Game Nov 10 '12 at 7:50