# Path: ctleweb/projtrack/models.py
# class Type(models.Model):
#     name = models.CharField(max_length=100)
# 
#     class Meta:
#         db_table = u'Type'
#         ordering = ['name']
# 
#     def __str__(self):
#         return self.name
# 
# class Client(models.Model):
#     first_name = models.CharField(max_length=100)
#     last_name = models.CharField(max_length=100)
#     email = models.CharField(max_length=100)
#     department = models.ForeignKey(Department,
#                                    on_delete=models.CASCADE)
# 
#     class Meta:
#         db_table = u'Client'
#         ordering = ['last_name']
# 
#     def __str__(self):
#         return str(self.last_name) + ", " + str(self.first_name)
# 
# class Department(models.Model):
#     name = models.CharField(max_length=100)
# 
#     class Meta:
#         db_table = u'Department'
#         ordering = ['name']
# 
#     def __str__(self):
#         return self.name
# 
# class Project(models.Model):
#     title = models.CharField(max_length=100)
#     description = models.CharField(max_length=500)
#     date = models.DateField(editable=False)
#     type = models.ForeignKey(Type, on_delete=models.CASCADE)
#     walk_in = models.BooleanField(default=False)
#     client = models.ForeignKey(Client, on_delete=models.CASCADE, blank=True, null=True)
#     users = models.ManyToManyField(User)
#     semester = models.ForeignKey(Semester, on_delete=models.CASCADE, blank=True, null=True)
#     hours = models.PositiveIntegerField(default=0)
#     completed = models.BooleanField(default=False)
# 
#     class Meta:
#         db_table = u'Project'
#         ordering = ['date']
# 
#     def __str__(self):
#         return self.title
# 
# class Semester(models.Model):
#     name = models.CharField(max_length=100)
# 
#     class Meta:
#         db_table = u'Semester'
#         ordering = ['name']
# 
#     def __str__(self):
#         return self.name


from django import forms
from django.contrib.auth.models import User
from django.forms import ModelForm, SelectDateWidget
from .models import Type, Client, Department, Project, Semester
    class Meta:
        model = Client
        field = '__all__'
        exclude = ()


class AddDeptForm(ModelForm):
    class Meta:
        model = Department
        field = '__all__'
        exclude = ()


class AddTypeForm(ModelForm):
    class Meta:
        model = Type
        field = '__all__'
        exclude = ()


class DateInput(forms.DateInput):
    input_type = 'date'


# noinspection PyUnresolvedReferences,PyUnresolvedReferences,PyUnresolvedReferences,PyUnresolvedReferences
class GenerateReportForm(forms.Form):
    start_date = forms.DateField(required=False, widget=SelectDateWidget(empty_label=("Year", "Month", "Day"),
                                                                         years=range(2010, 2025)))
    end_date = forms.DateField(required=False, widget=SelectDateWidget(empty_label=("Year", "Month", "Day"),
                                                                       years=range(2010, 2025)))

# Path: ctleweb/projtrack/models.py
# class Type(models.Model):
#     name = models.CharField(max_length=100)
# 
#     class Meta:
#         db_table = u'Type'
#         ordering = ['name']
# 
#     def __str__(self):
#         return self.name
# 
# class Client(models.Model):
#     first_name = models.CharField(max_length=100)
#     last_name = models.CharField(max_length=100)
#     email = models.CharField(max_length=100)
#     department = models.ForeignKey(Department,
#                                    on_delete=models.CASCADE)
# 
#     class Meta:
#         db_table = u'Client'
#         ordering = ['last_name']
# 
#     def __str__(self):
#         return str(self.last_name) + ", " + str(self.first_name)
# 
# class Department(models.Model):
#     name = models.CharField(max_length=100)
# 
#     class Meta:
#         db_table = u'Department'
#         ordering = ['name']
# 
#     def __str__(self):
#         return self.name
# 
# class Project(models.Model):
#     title = models.CharField(max_length=100)
#     description = models.CharField(max_length=500)
#     date = models.DateField(editable=False)
#     type = models.ForeignKey(Type, on_delete=models.CASCADE)
#     walk_in = models.BooleanField(default=False)
#     client = models.ForeignKey(Client, on_delete=models.CASCADE, blank=True, null=True)
#     users = models.ManyToManyField(User)
#     semester = models.ForeignKey(Semester, on_delete=models.CASCADE, blank=True, null=True)
#     hours = models.PositiveIntegerField(default=0)
#     completed = models.BooleanField(default=False)
# 
#     class Meta:
#         db_table = u'Project'
#         ordering = ['date']
# 
#     def __str__(self):
#         return self.title
# 
# class Semester(models.Model):
#     name = models.CharField(max_length=100)
# 
#     class Meta:
#         db_table = u'Semester'
#         ordering = ['name']
# 
#     def __str__(self):
#         return self.name


# Path: ctleweb/projtrack/forms.py
from django import forms
from django.contrib.auth.models import User
from django.forms import ModelForm, SelectDateWidget
from .models import Type, Client, Department, Project, Semester

    class Meta:
        model = Client
        field = '__all__'
        exclude = ()


class AddDeptForm(ModelForm):
    class Meta:
        model = Department
        field = '__all__'
        exclude = ()


class AddTypeForm(ModelForm):
    class Meta:
        model = Type
        field = '__all__'
        exclude = ()


class DateInput(forms.DateInput):
    input_type = 'date'


# noinspection PyUnresolvedReferences,PyUnresolvedReferences,PyUnresolvedReferences,PyUnresolvedReferences
class GenerateReportForm(forms.Form):
    start_date = forms.DateField(required=False, widget=SelectDateWidget(empty_label=("Year", "Month", "Day"),
                                                                         years=range(2010, 2025)))
    end_date = forms.DateField(required=False, widget=SelectDateWidget(empty_label=("Year", "Month", "Day"),
                                                                       years=range(2010, 2025)))

    semester = forms.ModelChoiceField(queryset=Semester.objects.all(),