Q:

How auto-fill model instance out of other models

I want to auto-fill model out of other model because  create new instance TimeDay every time I think stupid. 
I have 3 model:
CHOICE_DAYWEEK = ((1, 'Monday'), (2, 'Tuesday'), (3, 'Wednesday'))
CHOICE_TIME = ((6, '6:00'), (7, '7:00'), (8, '8:00'), (9, '9:00'))

class Day(models.Model):

    day = models.IntegerField(choices=CHOICE_DAYWEEK)

    def __unicode__(self):
        return self.day

class Time(models.Model):

    time = models.IntegerField(choices=CHOICE_TIME)

    def __unicode__(self):
        return self.time

class TimeDay(models.Model):

    day = models.ForeignKey(Day, on_delete=models.CASCADE)
    time = models.ForeignKey(Time, on_delete=models.CASCADE)
    entry = models.ForeignKey(Entry, blank=True, null=True, on_delete=models.CASCADE)

    def __unicode__(self):
        return '{} {}'.format(self.day.day, self.time.time)

I want to auto-fill model TimeDay for example:
TimeDay(id=1, day=1, time=6, entry=None) 
TimeDay(id=2, day=1, time=7, entry=None) 
... 
TimeDay(id=4, day=1, time=9, entry=None) 
... 
TimeDay(id=12, day=3, time=9, entry=None)

How I can do this without admin site and creating instances by hand?

A:

You should use DateTimeField with validation instead of writing separate model as below:
def validate_date(value):
    if not value.weekday() not in [0, 1, 2]:
        raise ValidationError("Day should be a Monday, Tuesday or Wednesday")
    # similarly implement validation for time
    if value.hour not in [6, 7, 8, 9] or value.minute != 0:
        raise ValidationError("Invalid Time")

class TimeDay(models.Model): 
    ...
    time = models.DateTimeField(validators=[validate_date])
    ...

