From 727c53ef8526877a65b181aba75600496baaa9d9 Mon Sep 17 00:00:00 2001 From: NitinVangipuram Date: Sun, 21 Jul 2024 21:53:34 +0530 Subject: [PATCH] changes to models --- CDC_Backend/APIs/companyViews.py | 4 ++-- CDC_Backend/APIs/models.py | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/CDC_Backend/APIs/companyViews.py b/CDC_Backend/APIs/companyViews.py index 389c4de..3a44d3f 100644 --- a/CDC_Backend/APIs/companyViews.py +++ b/CDC_Backend/APIs/companyViews.py @@ -40,7 +40,7 @@ def addPlacement(request): # opening.rs_eligible = True # else: # opening.rs_eligible = False - print(data[ELIGIBLESTUDENTS]) + if data[ELIGIBLESTUDENTS] is None: raise ValueError('Eligible Students cannot be empty') elif set(json.loads(data[ELIGIBLESTUDENTS])).issubset(ELIGIBLE): @@ -486,7 +486,7 @@ def addInternship(request): internship.eligiblestudents = json.loads(data[ELIGIBLESTUDENTS]) else: raise ValueError('Allowed Branch must be a subset of ' + str(ELIGIBLE)) - print(internship.eligiblestudents) + if data[PWD_ELIGIBLE] == 'Yes': internship.pwd_eligible = True else: diff --git a/CDC_Backend/APIs/models.py b/CDC_Backend/APIs/models.py index 3744a1c..74c4627 100644 --- a/CDC_Backend/APIs/models.py +++ b/CDC_Backend/APIs/models.py @@ -35,6 +35,8 @@ class Student(models.Model): can_apply_internship = models.BooleanField(default=True, verbose_name='Internship Registered') #added for internship changed_by = models.ForeignKey(User, blank=True, on_delete=models.RESTRICT, default=None, null=True) degree = models.CharField(choices=DEGREE_CHOICES, blank=False, max_length=10, default=DEGREE_CHOICES[0][0]) + isPwd = models.BooleanField(default=False, verbose_name='Person with Disability') + isBacklog = models.BooleanField(default=False, verbose_name='Has Backlog') history = HistoricalRecords(user_model=User) def __str__(self): @@ -141,12 +143,11 @@ class Placement(models.Model): tentative_no_of_offers = models.IntegerField(blank=False, default=None, null=True) expected_no_of_offers = models.IntegerField(blank=False , default=None , null=True) # newly added number_of_employees = models.IntegerField(blank=False, default=None, null=True) # newly added field - rs_eligible = models.BooleanField(blank=True, default=False) # needs to be deleted eligiblestudents = ArrayField( models.CharField(choices=ELIGIBLE_CHOICES, blank=False, max_length=10), size=10, default=list - ) + ) #newly added field pwd_eligible = models.BooleanField(blank=True, default=False) #newly added field backlog_eligible = models.BooleanField(blank=True, default=False) #newly added field psychometric_test = models.BooleanField(blank=True, default=False) #newly added field @@ -338,8 +339,6 @@ class Internship(models.Model): size=TOTAL_BATCHES, default=list ) - sophomore_eligible = models.BooleanField(blank=False, default=False) - rs_eligible = models.BooleanField(blank=False, default=False) # needs to be deleted eligiblestudents = ArrayField( models.CharField(choices=ELIGIBLE_CHOICES, blank=False, max_length=10), size=10,