コード例 #1
0
ファイル: forms.py プロジェクト: oluwatobimaxwell/timetabler
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

        newid = Functions.getNewId(Enrolment, 'ENR', "{:07}")
        self.fields["code"].initial = newid

        SESSION = Functions.SessionList()
        self.fields["session"] = forms.ChoiceField(
            choices=SESSION,
            required=False,
            widget=forms.Select(attrs={'class': 'form-control p-input'}))

        SEMESTERNAME = Functions.getSemesterAlias()
        self.fields["semesterName"] = forms.ChoiceField(
            label='Semester Name',
            choices=SEMESTERNAME,
            required=False,
            widget=forms.Select(attrs={'class': 'form-control p-input'}))

        SEMESTERTYPE = Functions.getSemestersList()
        self.fields["semesterType"] = forms.ChoiceField(
            label='Semester Type',
            choices=SEMESTERTYPE,
            required=False,
            widget=forms.Select(attrs={'class': 'form-control p-input'}))

        LEVEL = Functions.getStudentLevels()
        self.fields["level"] = forms.ChoiceField(
            choices=LEVEL,
            required=False,
            widget=forms.Select(attrs={'class': 'form-control p-input'}))
コード例 #2
0
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

        newid =  Functions.getNewId(TableRegister, 'TBL', "{:07}")
        self.fields["code"].initial = newid

        SESSION = Functions.SessionList()
        self.fields["session"] = forms.ChoiceField(initial=Functions.getSettingsData('session'), choices=SESSION, required=True, widget=forms.Select(attrs={'class':'form-control p-input'}))

        SEMESTERNAME = Functions.getSemesterAlias()
        self.fields["semestername"] = forms.ChoiceField(label='Semester', initial=Functions.getSettingsData('semname'), choices=SEMESTERNAME, required=not(Functions.getSemesterReq()), widget=forms.Select(attrs={'class':'form-control p-input'}))

        SEMESTERTYPE = Functions.getSemestersList()
        self.fields["semestertype"] = forms.ChoiceField(label='Semester', initial=Functions.getSettingsData('semtype'), choices=SEMESTERTYPE, required=Functions.getSemesterReq(), widget=forms.Select(attrs={'class':'form-control p-input'}))
コード例 #3
0
ファイル: forms.py プロジェクト: oluwatobimaxwell/timetabler
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

        self.fields['code'].widget.attrs['data-default-file'] = ''
        self.fields['code'].widget.attrs['class'] = 'dropify'

        SESSION = Functions.SessionList()
        self.fields["session"] = forms.ChoiceField(
            label='Session',
            choices=SESSION,
            required=False,
            widget=forms.Select(attrs={'class': 'form-control p-input'}))

        SEMESTERTYPE = Functions.getSemestersList()
        self.fields["semesterType"] = forms.ChoiceField(
            label='Semester Type',
            choices=SEMESTERTYPE,
            required=False,
            widget=forms.Select(attrs={'class': 'form-control p-input'}))
コード例 #4
0
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

        SUBJECTTYPE = Functions.subjectType()
        self.fields["subjecttype"] = forms.ChoiceField(
            label='Subject Type',
            choices=SUBJECTTYPE,
            required=True,
            widget=forms.Select(attrs={'class': 'form-control p-input'}))

        SEMESTER = Functions.getSemestersList()
        self.fields["semester"] = forms.ChoiceField(
            label='Semester',
            choices=SEMESTER,
            required=Functions.getSemesterReq(),
            widget=forms.Select(attrs={'class': 'form-control p-input'}))

        DEPARTMENTS = Functions.getDepartmentList()
        self.fields["departments"] = forms.MultipleChoiceField(
            label='Department(s)',
            choices=DEPARTMENTS,
            required=True,
            widget=forms.SelectMultiple(
                attrs={
                    'class': 'form-control p-input populate-drop',
                    'singular': '0',
                    'data-source': 'department',
                    'data-link': 'lecturers',
                    'data-live-search': 'true',
                }))

        LECTURERS = Functions.getLecturerList(
        )  #Functions.getLectConfirm(Functions.getLecturerList(), Course)
        self.fields["lecturers"] = forms.MultipleChoiceField(
            label='Lecturer(s)',
            choices=LECTURERS,
            required=False,
            widget=forms.SelectMultiple(attrs={
                'class': 'form-control p-input',
                'data-live-search': 'true'
            }))