Я работаю над проектом, рассчитанным на двухнедельный период. У меня есть модель с start_date и end_date, как показано ниже:
Код: Выделить всё
class CreateNewTimesheet(models.Model):
employee = models.ForeignKey(Employee, on_delete=models.CASCADE)
start_date = models.DateField(_("Start Date"))
end_date = models.DateField(_("End Date"))
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
Код: Выделить всё
Dates: 03/06/2024 - 03/16/2024
And group or tie that to "week 1".
After start_date and end_date are entered I need them to be tied to week one. I was thinking about adding another line to the CreateNew model and then tie that to week one. And then each start_date and end_date are entered, a new "week" is entered for each new start_date and end_date is created. Should that be based off of created_at entry? Should each week be grouped by a new url?
I am honestly stuck at this point about both grouping by two weeks and then tying to a new week.
Источник: https://stackoverflow.com/questions/781 ... data-entry