Untitled

mail@pastecode.io avatar
unknown
python
2 years ago
546 B
1
Indexable
Never
class Member(models.Model):
    user = models.OneToOneField(User, on_delete=models.CASCADE, null=True, blank=True)
    member_skills = models.ManyToManyField('Skills')



class Skills(models.Model):
    skill_name = models.CharField(max_length=50, blank=True)


class MemberSkill(models.Model):
    member = models.ForeignKey(Member, on_delete=models.CASCADE)
    skill = models.ForeignKey(Skills, on_delete=models.CASCADE)
    upvotes = models.IntegerField(default=0)
    upvoted_by = models.ManyToManyField(User, related_name='upvoted_skills')