# Path: promotion/models.py
# class JoinApplication(models.Model):
#     name = models.CharField(max_length=200)
#     email = models.EmailField()
#     roll_number = models.CharField(max_length=100, blank=True, null=True)
#     batch = models.CharField(max_length=100, choices=batch_choices)
#     motivation = models.TextField()
#     cs_background = models.TextField(blank=True)
#     interests = models.TextField()
#     contribution = models.TextField(default='NULL')
#     is_approved = models.BooleanField(default=False)
#     is_rejected = models.BooleanField(default=False)
# 
#     date = models.DateTimeField(auto_now_add=True, auto_now=False)
# 
#     def __str__(self):
#         return self.name
# 
#     def get_absolute_url(self):
#         return reverse('join_detail', kwargs={'pk': self.pk})
# 
#     class Meta:
#         ordering = ('date',)


from captcha.fields import ReCaptchaField
from django import forms
from promotion.models import JoinApplication
    batch = forms.ChoiceField(choices=batch_choices, label='Batch', help_text="Enter your current year")

    motivation = forms.CharField(label='Why do you want to join FOSS?',
                                 help_text="Write briefly about why you would like to join us. Please answer " +
                                           "carefully, this is an important factor in our selection process ",
                                 widget=forms.Textarea(attrs={'placeholder': 'Why should we select you?'}))

    cs_background = forms.CharField(label='Technical knowledge',
                                    help_text="Experience in computer science. It's okay to leave this blank "
                                              "if you are new to Computer Science", required=False,
                                    widget=forms.Textarea(attrs={'placeholder': 'example: I studied C++ in my School.' +
                                                                                ' I have made a game using Python.'}))

    interests = forms.CharField(label='Interests', help_text="Write about your interests, passions and hobbies",
                                widget=forms.Textarea(attrs={'placeholder': 'example: I love reading books.'}))

    contribution = forms.CharField(label='Contribution',
                                   help_text="How would you like to contribute to the growth of the club?",
                                   widget=forms.Textarea(attrs={'placeholder': 'I would like to help in ..'}))

    captcha = ReCaptchaField(attrs={
        'theme': 'clean',
    })

    def __init__(self, *args, **kwargs):
        super(JoinApplicationForm, self).__init__(*args, **kwargs)
        for field in iter(self.fields):
            self.fields[field].widget.attrs.update({'class': 'form-control'})

    class Meta:

# Path: promotion/models.py
# class JoinApplication(models.Model):
#     name = models.CharField(max_length=200)
#     email = models.EmailField()
#     roll_number = models.CharField(max_length=100, blank=True, null=True)
#     batch = models.CharField(max_length=100, choices=batch_choices)
#     motivation = models.TextField()
#     cs_background = models.TextField(blank=True)
#     interests = models.TextField()
#     contribution = models.TextField(default='NULL')
#     is_approved = models.BooleanField(default=False)
#     is_rejected = models.BooleanField(default=False)
# 
#     date = models.DateTimeField(auto_now_add=True, auto_now=False)
# 
#     def __str__(self):
#         return self.name
# 
#     def get_absolute_url(self):
#         return reverse('join_detail', kwargs={'pk': self.pk})
# 
#     class Meta:
#         ordering = ('date',)


# Path: promotion/forms.py
from captcha.fields import ReCaptchaField
from django import forms
from promotion.models import JoinApplication

    batch = forms.ChoiceField(choices=batch_choices, label='Batch', help_text="Enter your current year")

    motivation = forms.CharField(label='Why do you want to join FOSS?',
                                 help_text="Write briefly about why you would like to join us. Please answer " +
                                           "carefully, this is an important factor in our selection process ",
                                 widget=forms.Textarea(attrs={'placeholder': 'Why should we select you?'}))

    cs_background = forms.CharField(label='Technical knowledge',
                                    help_text="Experience in computer science. It's okay to leave this blank "
                                              "if you are new to Computer Science", required=False,
                                    widget=forms.Textarea(attrs={'placeholder': 'example: I studied C++ in my School.' +
                                                                                ' I have made a game using Python.'}))

    interests = forms.CharField(label='Interests', help_text="Write about your interests, passions and hobbies",
                                widget=forms.Textarea(attrs={'placeholder': 'example: I love reading books.'}))

    contribution = forms.CharField(label='Contribution',
                                   help_text="How would you like to contribute to the growth of the club?",
                                   widget=forms.Textarea(attrs={'placeholder': 'I would like to help in ..'}))

    captcha = ReCaptchaField(attrs={
        'theme': 'clean',
    })

    def __init__(self, *args, **kwargs):
        super(JoinApplicationForm, self).__init__(*args, **kwargs)
        for field in iter(self.fields):
            self.fields[field].widget.attrs.update({'class': 'form-control'})

    class Meta:

        model = JoinApplication