<commit_before># -*- coding: utf-8 -*-
from django import forms
from django.conf import settings
from django.db.models import Count
from django.contrib.auth.models import User
from django.utils.safestring import mark_safe
from django.core.validators import URLValidator
from django.forms.extras.widgets import SelectDateWidget

from djspace.application.models import *
from djspace.core.models import PAST_FUNDING_YEAR_CHOICES
from djspace.core.utils import get_start_date
#from djtools.fields.validators import MimetypeValidator
from djtools.fields import BINARY_CHOICES

'''
UploadsForms are for the user dashboard where file uploads
take place after the application has been approved and
additional files are required
'''


class HigherEducationInitiativesForm(forms.ModelForm):

    past_funding = forms.TypedChoiceField(
        label="Have you received WSGC funding within the past five years?",
        choices = BINARY_CHOICES, widget = forms.RadioSelect()
    )
    past_funding_year = forms.CharField(
        label="If 'Yes', what year?",
        widget=forms.Select(choices=PAST_FUNDING_YEAR_CHOICES),
        required = False
    )
    other_fellowship = forms.TypedChoiceField(
        label="""
            Do you currently hold another Federal fellowship or traineeship?
        """,
        choices = BINARY_CHOICES, widget = forms.RadioSelect()
    )

    class Meta:
        model = HigherEducationInitiatives
        exclude = (
            'complete','user','status','funded_code','funds_authorized',
            'authorized_match', 'award_acceptance','final_report',
            'interim_report','invoice','intended_program_match',
            'close_out_finance_document'
        )
        fields = (
            'project_title','award_type','funds_requested','proposed_match',
            'source_match','begin_date', 'end_date', 'location','synopsis',
            'proposal','budget','past_funding','past_funding_year',
            'other_fellowship','other_fellowship_explain',
            'finance_officer_name','finance_officer_title',
            'finance_officer_address',
            'finance_officer_email','finance_officer_phone',
            'grant_officer_name','grant_officer_address',
            'grant_officer_email','grant_officer_phone'
        )


class HigherEducationInitiativesUploadsForm(forms.ModelForm):

    class Meta:
        model = HigherEducationInitiatives
        fields = (
            'award_acceptance','final_report','interim_report',
            'invoice','intended_program_match','close_out_finance_document'
        )


class ProfessionalProgramStudentUploadsForm(forms.ModelForm):

    class Meta:
        model = HigherEducationInitiatives
        fields = (
            'award_acceptance','interim_report'
        )


class ResearchInfrastructureForm(forms.ModelForm):

    past_funding = forms.TypedChoiceField(
        label="Have you received WSGC funding within the past five years?",
        choices = BINARY_CHOICES, widget = forms.RadioSelect()
    )
    past_funding_year = forms.CharField(
        label="If 'Yes', what year?",
        widget=forms.Select(choices=PAST_FUNDING_YEAR_CHOICES),
        required = False<commit_msg>added 'final_report' to the list of file fields on the professional program student files form<commit_after># -*- coding: utf-8 -*-
from django import forms
from django.conf import settings
from django.db.models import Count
from django.contrib.auth.models import User
from django.utils.safestring import mark_safe
from django.core.validators import URLValidator
from django.forms.extras.widgets import SelectDateWidget

from djspace.application.models import *
from djspace.core.models import PAST_FUNDING_YEAR_CHOICES
from djspace.core.utils import get_start_date
#from djtools.fields.validators import MimetypeValidator
from djtools.fields import BINARY_CHOICES

'''
UploadsForms are for the user dashboard where file uploads
take place after the application has been approved and
additional files are required
'''


class HigherEducationInitiativesForm(forms.ModelForm):

    past_funding = forms.TypedChoiceField(
        label="Have you received WSGC funding within the past five years?",
        choices = BINARY_CHOICES, widget = forms.RadioSelect()
    )
    past_funding_year = forms.CharField(
        label="If 'Yes', what year?",
        widget=forms.Select(choices=PAST_FUNDING_YEAR_CHOICES),
        required = False
    )
    other_fellowship = forms.TypedChoiceField(
        label="""
            Do you currently hold another Federal fellowship or traineeship?
        """,
        choices = BINARY_CHOICES, widget = forms.RadioSelect()
    )

    class Meta:
        model = HigherEducationInitiatives
        exclude = (
            'complete','user','status','funded_code','funds_authorized',
            'authorized_match', 'award_acceptance','final_report',
            'interim_report','invoice','intended_program_match',
            'close_out_finance_document'
        )
        fields = (
            'project_title','award_type','funds_requested','proposed_match',
            'source_match','begin_date', 'end_date', 'location','synopsis',
            'proposal','budget','past_funding','past_funding_year',
            'other_fellowship','other_fellowship_explain',
            'finance_officer_name','finance_officer_title',
            'finance_officer_address',
            'finance_officer_email','finance_officer_phone',
            'grant_officer_name','grant_officer_address',
            'grant_officer_email','grant_officer_phone'
        )


class HigherEducationInitiativesUploadsForm(forms.ModelForm):

    class Meta:
        model = HigherEducationInitiatives
        fields = (
            'award_acceptance','final_report','interim_report',
            'invoice','intended_program_match','close_out_finance_document'
        )


class ProfessionalProgramStudentUploadsForm(forms.ModelForm):

    class Meta:
        model = HigherEducationInitiatives
        fields = (
            'award_acceptance','interim_report','final_report'
        )


class ResearchInfrastructureForm(forms.ModelForm):

    past_funding = forms.TypedChoiceField(
        label="Have you received WSGC funding within the past five years?",
        choices = BINARY_CHOICES, widget = forms.RadioSelect()
    )
    past_funding_year = forms.CharField(
        label="If 'Yes', what year?",
        widget=forms.Select(choices=PAST_FUNDING_YEAR_CHOICES),
        required = False
{'fraction_non_alphanumeric': 0.08997231621039681, 'fraction_numerical': 0.00030759766225776686, 'mean_word_length': 3.481736733287388, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3801447', 'n_tokens_mistral': 1899, 'n_tokens_neox': 1804, 'n_words': 375}