<gh_stars>0
import datetime

from django.forms import ModelForm, Select

from .models import TaskHour

HOUR_CHOICES = [(datetime.time(hour=x), f'{x}') for x in range(0, 24)]
MINUTE_CHOICES = [(datetime.time(minute=x), f'{x}') for x in range(0, 60)]


class TaskHourSelection(ModelForm):
    class Meta:
        model = TaskHour
        fields = '__all__'
        widgets = {
            'hours': Select(choices=HOUR_CHOICES),
            'minutes': Select(choices=MINUTE_CHOICES)
        }

import datetime

from django.forms import ModelForm, Select

from .models import TaskHour

HOUR_CHOICES = [(datetime.time(hour=x), f'{x}') for x in range(0, 24)]
MINUTE_CHOICES = [(datetime.time(minute=x), f'{x}') for x in range(0, 60)]


class TaskHourSelection(ModelForm):
    class Meta:
        model = TaskHour
        fields = '__all__'
        widgets = {
            'hours': Select(choices=HOUR_CHOICES),
            'minutes': Select(choices=MINUTE_CHOICES)
        }