@@ -483,6 +483,7 @@ def clean_company_name(self):
483483
484484 return company_name
485485
486+
486487def current_year ():
487488 return date .today ().year
488489
@@ -545,6 +546,87 @@ class SearchPbiRecord(forms.Form):
545546 label = "cname" , required = False )
546547
547548
549+
550+ class SendInvitation (forms .Form ):
551+ """
552+ The form is used to send invite to students about upcoming placement or pbi events.
553+ @variables:
554+ company - name of company
555+ """
556+ company = forms .ModelChoiceField (required = True , queryset = NotifyStudent .objects .all (), label = "company" )
557+ rollno = forms .IntegerField (label = "rollno" , widget = forms .NumberInput (attrs = {'min' : 0 }), required = False )
558+ programme = forms .ChoiceField (choices = Con .PROGRAMME , required = False ,
559+ label = "programme" , widget = forms .Select (attrs = {'style' : "height:45px" ,
560+ 'onchange' : "changeDeptForSend()" ,
561+ 'id' : "id_programme_send" }))
562+
563+ dep_btech = forms .MultipleChoiceField (choices = Constants .BTECH_DEP , required = False , label = "department" ,
564+ widget = forms .CheckboxSelectMultiple )
565+ dep_bdes = forms .MultipleChoiceField (choices = Constants .BDES_DEP , required = False , label = "department" ,
566+ widget = forms .CheckboxSelectMultiple )
567+ dep_mtech = forms .MultipleChoiceField (choices = Constants .MTECH_DEP , required = False , label = "department" ,
568+ widget = forms .CheckboxSelectMultiple )
569+ dep_mdes = forms .MultipleChoiceField (choices = Constants .MDES_DEP , required = False , label = "department" ,
570+ widget = forms .CheckboxSelectMultiple )
571+ dep_phd = forms .MultipleChoiceField (choices = Constants .PHD_DEP , required = False , label = "department" ,
572+ widget = forms .CheckboxSelectMultiple )
573+ cpi = forms .DecimalField (label = "cpi" , required = False )
574+ no_of_days = forms .CharField (required = True , widget = forms .NumberInput (attrs = { 'min' :0 ,
575+ 'max' :30 ,
576+ 'max_length' : 10 ,
577+ 'class' : 'form-control' }))
578+
579+
580+ class AddPlacementSchedule (forms .Form ):
581+ """
582+ The form is used to placement or pbi schedule.
583+ @variables:
584+ time - time of placement activity
585+ ctc - salary
586+ company_name - name of company
587+ placement_type - placement type (placement/pbi)
588+ location - location of company
589+ description - description of company
590+ placement_date - date of placement activity
591+ """
592+ time = forms .TimeField (label = 'time' , widget = forms .widgets .TimeInput (attrs = {'type' : "time" ,
593+ 'value' :"00:00" ,
594+ 'min' :"0:00" ,
595+ 'max' :"24:00" }))
596+ ctc = forms .DecimalField (label = "ctc" , widget = forms .NumberInput (attrs = { 'min' :0 , 'step' : 0.25 }) )
597+ company_name = forms .CharField (widget = forms .TextInput (attrs = {'max_length' : 100 ,
598+ 'class' : 'field' ,
599+ 'list' : 'company_dropdown1' ,
600+ 'id' : 'company_input' }),
601+ label = "company_name" )
602+ placement_type = forms .ChoiceField (widget = forms .Select (attrs = {'style' : "height:45px" }), label = "placement_type" ,
603+ choices = Constants .PLACEMENT_TYPE )
604+ location = forms .CharField (widget = forms .TextInput (attrs = {'max_length' : 100 ,
605+ 'class' : 'field' }),
606+ label = "location" )
607+ description = forms .CharField (widget = forms .Textarea (attrs = {'max_length' : 1000 ,
608+ 'class' : 'form-control' }),
609+ label = "description" , required = False )
610+ attached_file = forms .FileField (required = False )
611+ placement_date = forms .DateField (label = 'placement_date' , widget = forms .DateInput (attrs = {'class' :'datepicker' }))
612+
613+ def clean_ctc (self ):
614+ ctc = self .cleaned_data ['ctc' ]
615+ # print('form validation \n\n\n\n', ctc)
616+ if ctc <= 0 :
617+ raise forms .ValidationError ("CTC must be positive value" )
618+
619+ return ctc
620+
621+ def clean_company_name (self ):
622+ company_name = self .cleaned_data ['company_name' ]
623+ # print('form validation \n\n\n\n', ctc)
624+ if NotifyStudent .objects .filter (company_name = company_name ):
625+ raise forms .ValidationError ("company_name must be unique" )
626+
627+ return company_name
628+
629+
548630class SearchHigherRecord (forms .Form ):
549631 """
550632 The form is used to search from higher study record based on various parameters .
0 commit comments