Actually, this question has puzzled me for a long time.
Say, I have two models, Course
and CourseDate
, as follows:
class Course(models.Model):
name = model.CharField()
class CourseDate(models.Model):
course = modelds.ForienKey(Course)
date = models.DateField()
where CourseDate
is the dates that a certain course will take place.
I could also define Course
as follows and discard CourseDate
:
class Course(models.Model):
name = models.CharField()
dates = models.CharField()
where the dates
field contains dates represented by strings. For example:
dates = '2016-10-1,2016-10-12,2016-10-30'
I don't know if the second solution is kind of "cheating". So, which one is better?