i want filter the student data by the skills in the vacancy and then send it to the company who posted the requirements in vacancy via email.does anyone have idea about this.
** The Model**
class Student(models.Model):
name = models.CharField(max_length=50)
skills = models.ManyToManyField(Skill)
passout = models.ManyToManyField(Passout)
email = models.EmailField(max_length=254 ,null = True)
resume = models.ImageField(upload_to='media/resume', height_field=None, width_field=None, max_length=None , null=True)
create_date = models.DateTimeField('created date',auto_now_add=True)
def __str__(self):
return self.name
class Company(models.Model):
comp_name = models.CharField(max_length=50)
loc = models.CharField(max_length=50)
hr_name = models.CharField(max_length=50)
hr_email = models.EmailField(max_length=254)
def __str__(self):
return self.comp_name
class Vacanccy(models.Model):
com_name = models.ForeignKey(Company, on_delete=models.CASCADE)
skillreq = models.ManyToManyField(Skill)
yearofpass = models.ManyToManyField(Passout)
title = models.CharField(max_length=255)
expiry_date = models.CharField(max_length=50)
def __str__(self):
return str(self.com_name)
the above image 1st tabel is student , 2nd is company, 3rd is vacancy
In Vacancy table two companies posted their requirements. The 1st company have matching profile of rini , also 2nd remya
If we filter the data and it should send to the corresponding company like rini details to dell and remya details to redmi