# Path: oshc/main/models.py
# class Contest(models.Model):
#     name = models.CharField(max_length=128, help_text="Contest name")
#     link = models.URLField(help_text="URL of the contest's website")
#     description = models.TextField(
#         max_length=512, help_text="Contest details", null=True)
#     start_date = models.DateField(null=True)
#     end_date = models.DateField(null=True)
#     approved = models.BooleanField(default=False)
# 
#     def __str__(self):
#         return self.name


from django import forms
from crispy_forms.helper import FormHelper
from .models import Contest


class ContestForm(forms.ModelForm):
    def __init__(self, *args, **kwargs):
        super(ContestForm, self).__init__(*args, **kwargs)
        self.helper = FormHelper()
        self.helper.form_tag = False
        self.helper.label_class = 'col-lg-2'
        self.helper.field_class = 'col-lg-8'
        self.fields['start_date'].widget.attrs['class'] = 'datepicker'
        self.fields['end_date'].widget.attrs['class'] = 'datepicker'

    class Meta:

# Path: oshc/main/models.py
# class Contest(models.Model):
#     name = models.CharField(max_length=128, help_text="Contest name")
#     link = models.URLField(help_text="URL of the contest's website")
#     description = models.TextField(
#         max_length=512, help_text="Contest details", null=True)
#     start_date = models.DateField(null=True)
#     end_date = models.DateField(null=True)
#     approved = models.BooleanField(default=False)
# 
#     def __str__(self):
#         return self.name


# Path: oshc/main/forms.py
from django import forms
from crispy_forms.helper import FormHelper
from .models import Contest



class ContestForm(forms.ModelForm):
    def __init__(self, *args, **kwargs):
        super(ContestForm, self).__init__(*args, **kwargs)
        self.helper = FormHelper()
        self.helper.form_tag = False
        self.helper.label_class = 'col-lg-2'
        self.helper.field_class = 'col-lg-8'
        self.fields['start_date'].widget.attrs['class'] = 'datepicker'
        self.fields['end_date'].widget.attrs['class'] = 'datepicker'

    class Meta:

        model = Contest