diff --git a/jobposting/models.py b/jobposting/models.py index 554257f..2c14504 100644 --- a/jobposting/models.py +++ b/jobposting/models.py @@ -37,14 +37,14 @@ class JobListing(models.Model): created_at = models.DateTimeField(default=timezone.now) status = models.CharField(max_length=1, choices=status_choices, default='W') status_paid = models.CharField(max_length=1, choices=paid_status, default='N') - # category = models.CharField(max_length=255, null=True, blank=True) + category = models.CharField(max_length=255, null=True, blank=True) expiration_date = models.DateTimeField(null=True, blank=True) image = models.CharField(max_length=255, null=True, blank=True) experience_level = models.CharField(max_length=255, null=True, blank=True) employment_type = models.CharField(max_length=255, null=True, blank=True) work_from_home = models.CharField(max_length=255) updated_at = models.DateTimeField(auto_now=True) - # skillLevels = models.ManyToManyField('SkillLevels', blank=True) + skill_levels = models.JSONField(null=True, blank=True, defualt=list) anonymous_user_data = models.ForeignKey(AnonymousUserData, null=True, blank=True, @@ -71,19 +71,6 @@ class Skill(models.Model): def __str__(self): return f"{self.skill_name}" -class SkillLevels(models.Model): - - proficiency_choices = [ - ('N', 'Nice to have'), - ('B', 'Podstawowy'), - ('M', 'Średnio zaawansowany'), - ('A', 'Zaawansowany'), - ('E', 'Ekspert'), - ] - - skill_id = models.ForeignKey(Skill, on_delete=models.CASCADE) - skill_level = models.CharField(max_length=1, choices=proficiency_choices,) - jobposting_id = models.ForeignKey(JobListing, on_delete=models.CASCADE) class CompanyLogo(models.Model): company_logo = models.ImageField(upload_to=rename_file) diff --git a/jobposting/serializers.py b/jobposting/serializers.py index b831562..36757ba 100644 --- a/jobposting/serializers.py +++ b/jobposting/serializers.py @@ -32,9 +32,11 @@ class JobListingSerializer(serializers.ModelSerializer): fields = [ 'id', 'posting_option', 'company_name', 'name', 'content', 'minsalary', 'maxsalary', - 'localization', 'created_by', 'created_at', 'status', 'status_paid', - 'expiration_date', 'experience_level', 'employment_type', 'work_from_home', - 'updated_at', 'contact_email', 'first_name', 'last_name', 'anonymous_user_data' + 'localization', 'created_by', 'created_at', 'status', + 'status_paid', 'expiration_date', 'experience_level', + 'employment_type', 'work_from_home', 'updated_at', 'skill_levels', + 'contact_email', 'first_name', 'last_name', 'anonymous_user_data', + 'category', 'webpage', 'image', 'requiresalary', 'vat_number' ] class CompanyLogoSerializer(serializers.ModelSerializer):