skill = Skill.objects.get(...
recruits = Recruitment.objects.filter(cv__skill=skill)
recruits = Recruitment.objects.filter(cv__skill=skill)
On May 13, 2023 4:55:36 PM CDT, Oduwa Imade <oduwa2013@gmail.com> wrote:
Hello Guys! How do I write a model query in django python to get the User details(Recruitment) when i pass a search parameter( skill) to the Skill table?
class Recruitment(models.Model):
fname = models.CharField(max_length=50)
lname = models.CharField(max_length=50)
address = models.CharField(max_length=100)
phone = models.IntegerField()
email = models.CharField(max_length=50)
password = models.CharField(max_length=30)
class CV(models.Model):
summary = models.TextField()
f_key_REC = models.ForeignKey(Recruitment, related_name='cv', on_delete=models.CASCADE)
class Skill(models.Model):
sk1 = models.CharField(max_length=100, default=None)
sk2 = models.CharField(max_length=100, default=None)
sk3 = models.CharField(max_length=100, default=None)
fk_sCV = models.ForeignKey(CV, related_name='skill', on_delete=models.CASCADE)
No comments:
Post a Comment