NameError: name 'get_date_diff' is not defined
class Reservation(models.Model):
#...
order_date = models.DateTimeField(auto_now_add=True, verbose_name='Создана')
checkin = models.DateField(verbose_name='Дата заезда')
checkout = models.DateField(verbose_name='Дата выезда')
days = get_date_diff()
def get_date_diff(self):
return [self.checkout + datetime.timedelta(i) for i in range((self.checkout - self.checkin).days)]
TypeError: get_date_diff() takes exactly 1 argument (0 given)
def get_date_diff(self):
return [self.checkout + datetime.timedelta(i) for i in range((self.checkout - self.checkin).days)]
days = get_date_diff() # days после метода