Ejemplo n.º 1
0
    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'}))
Ejemplo n.º 2
0
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

        newid = Functions.getNewId(Lecturers, 'LEC', "{:04}")
        self.fields["code"].initial = newid

        PRIORITY = []
        for x in range(1, Functions.getMaxPriority()):
            PRIORITY.append((x, x))
        # self.fields["priorityNumber"] = forms.ChoiceField(label='Priority Number', choices=PRIORITY, required=True, widget=forms.Select(attrs={'class':'form-control p-input'}))
        self.fields["facultyLec"].queryset = Faculty.objects.filter()
        self.fields["departmentLec"].queryset = Department.objects.filter()
Ejemplo n.º 3
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'}))
Ejemplo n.º 4
0
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

        newid = Functions.getNewId(Department, 'DPT', "{:03}")
        self.fields["code"].initial = newid

        CHOICES = Functions.getOfficersList()
        self.fields["officer"] = forms.ChoiceField(
            choices=CHOICES,
            required=False,
            widget=forms.Select(attrs={
                'data-live-search': 'true',
                'class': 'form-control p-input'
            }))

        self.fields["faculty"].queryset = Faculty.objects.filter()
Ejemplo n.º 5
0
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

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

        newid = Functions.getNewId(Faculty, 'FAC', "{:02}")
        self.fields["code"].initial = newid

        CHOICES = Functions.getOfficersList()
        self.fields["officer"] = forms.ChoiceField(
            choices=CHOICES,
            required=False,
            widget=forms.Select(attrs={
                'data-live-search': 'true',
                'class': 'form-control p-input'
            }))
Ejemplo n.º 6
0
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

        newid = Functions.getNewId(Venue, 'VEN', "{:03}")
        self.fields["code"].initial = newid

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

        LEVELS = Functions.getStudentLevels()
        AVAILABLEDAYS = Functions.getDaysAvailable()
        FACULTIES = Functions.getFacultyList()
        DEPARTMENTS = Functions.getDepartmentList()

        self.fields["reservedDays"] = forms.MultipleChoiceField(
            label='Days',
            choices=AVAILABLEDAYS,
            widget=forms.SelectMultiple(
                attrs={
                    'class': 'selectpicker w-100',
                    'multiple': 'multiple',
                    'style': 'width:100%',
                }))

        self.fields["reservedLevel"] = forms.MultipleChoiceField(
            label='Levels',
            choices=LEVELS,
            widget=forms.SelectMultiple(
                attrs={
                    'class': 'selectpicker w-100',
                    'multiple': 'multiple',
                    'style': 'width:100%',
                }))

        self.fields["reservedFaculty"] = forms.MultipleChoiceField(
            label='Faculties',
            choices=FACULTIES,
            widget=forms.SelectMultiple(
                attrs={
                    'class': 'selectpicker w-100 populate-drop',
                    'multiple': 'multiple',
                    'data-live-search': 'true',
                    'style': 'width:100%',
                    'data-source': 'faculty',
                    'data-link': 'reservedDepartment',
                    'singular': '0',
                }))

        self.fields["reservedDepartment"] = forms.MultipleChoiceField(
            label='Departments',
            choices=DEPARTMENTS,
            widget=forms.SelectMultiple(
                attrs={
                    'class': 'selectpicker w-100',
                    'multiple': 'multiple',
                    'data-live-search': 'true',
                    'style': 'width:100%',
                }))
Ejemplo n.º 7
0
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

        newid = Functions.getNewId(staffTypes, '', "{:01}")
        self.fields["type"].initial = newid