IZAAC_BASE - modele jobposting, wymagane biblioteki, ustawienia projektu
All checks were successful
continuous-integration/drone Build is passing

This commit is contained in:
Jakub K
2023-11-11 21:18:23 +01:00
parent dacc0e8c98
commit 16598a03ea
10 changed files with 143 additions and 1 deletions

0
jobposting/__init__.py Normal file
View File

3
jobposting/admin.py Normal file
View File

@@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

6
jobposting/apps.py Normal file
View File

@@ -0,0 +1,6 @@
from django.apps import AppConfig
class JobpostingConfig(AppConfig):
default_auto_field = "django.db.models.BigAutoField"
name = "jobposting"

View File

60
jobposting/models.py Normal file
View File

@@ -0,0 +1,60 @@
from django.db import models
from django.contrib.auth.models import User
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()
min_salary = models.DecimalField(max_digits=10, decimal_places=2)
max_salary = models.DecimalField(max_digits=10, decimal_places=2)
location = models.CharField(max_length=255)
coordinates = models.CharField(max_length=255) # rozwaz GEODJANGO
created_by = models.ForeignKey(User, on_delete=models.CASCADE, related_name='job_listings')
created_at = models.DateTimeField(default=timezone.now)
status = models.CharField(max_length=1, choices=status_choices, default='A')
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_description = models.TextField(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)
contract_type = models.CharField(max_length=255, null=True, blank=True)
is_remote = models.BooleanField(default=False)
updated_at = models.DateTimeField(auto_now=True)
def __str__(self):
return f"{self.name} at {self.company_name}"
class Skill(models.Model):
name = models.CharField(max_length=255)
proficiency_choices = [
('B', 'Podstawowy'),
('A', 'Zaawansowany'),
('E', 'Ekspert'),
]
proficiency = models.CharField(max_length=1, choices=proficiency_choices)
def __str__(self):
return self.name
class JobSkill(models.Model):
job_listing = models.ForeignKey(JobListing, on_delete=models.CASCADE, related_name='job_skills')
skill = models.ForeignKey(Skill, on_delete=models.CASCADE, related_name='job_skills')
proficiency = models.CharField(max_length=255)
def __str__(self):
return f"{self.skill.name} for {self.job_listing.name} ({self.proficiency})"

3
jobposting/tests.py Normal file
View File

@@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

3
jobposting/views.py Normal file
View File

@@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.