changes to models

This commit is contained in:
NitinVangipuram 2024-07-21 21:53:34 +05:30
parent 6a46dc0dcd
commit 727c53ef85
2 changed files with 5 additions and 6 deletions

View File

@ -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:

View File

@ -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,