izaac/jobposting/models.py
Jakub K 25946fbbd1
All checks were successful
continuous-integration/drone Build is passing
dodanie nowych pól, dostosowanie do pol w front
2023-12-18 19:01:08 +01:00

60 lines
2.3 KiB
Python

from django.db import models
from core.models import MyUser
from django.utils import timezone
class JobListing(models.Model):
status_choices = [
('A', 'Aktywna'),
('C', 'Zakończona'),
('W', 'Oczekująca na sprawdzenie'),
('R', 'Zarchiwizowana'),
]
paid_status = [
('P', 'Oplacona'),
('N', 'Nieoplacona'),
('D', 'Inny status')
]
company_name = models.CharField(max_length=255)
name = models.CharField(max_length=255)
content = models.TextField()
minsalary = models.IntegerField()
maxsalary = models.IntegerField()
requiresalary = models.BooleanField()
webpage = models.CharField(max_length=255)
localization = models.CharField(max_length=255)
vat_number = models.CharField(max_length=10)
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)
expiration_date = models.DateField(null=True, blank=True)
# company_logo = models.ImageField(upload_to='company_logos/', null=True, blank=True)
experience_level = models.CharField(max_length=255, null=True, blank=True)
employmentType = models.CharField(max_length=255, null=True, blank=True)
workFromHome = models.CharField(max_length=255)
updated_at = models.DateTimeField(auto_now=True)
job_skills = models.ManyToManyField(SkillLevels, on_delete=models.CASCADE)
created_by = models.ForeignKey(MyUser, on_delete=models.CASCADE)
first_name = models.CharField(max_length=255)
last_name = models.CharField(max_length=255)
contact_email = models.EmailField(max_length=255, null=True, blank=True)
def __str__(self):
return f"{self.name} at {self.company_name}"
class SkillLevels(models.Model):
proficiency_choices = [
('N', 'Nice to have'),
('B', 'Podstawowy'),
('M', 'Średnio zaawansowany'),
('A', 'Zaawansowany'),
('E', 'Ekspert'),
]
jobPostingId = models.ForeignKey(JobListing, on_delete=models.CASCADE)
skill_name =models.CharField(max_length=255)
skill_level = models.CharField(max_length=1, choices=proficiency_choices,)