Skip to content

Commit 840ecfe

Browse files
committed
Добавлено поле Специализация в модель Вакансии; Переработаны сериализатор и административная панель; Создана миграция.
1 parent 34ac1a9 commit 840ecfe

4 files changed

Lines changed: 30 additions & 0 deletions

File tree

vacancy/admin.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class VacancySkillToObjectInline(SkillToObjectInline):
1515
class VacancyAdmin(admin.ModelAdmin):
1616
list_display = [
1717
"role",
18+
"specialization",
1819
"description",
1920
"project",
2021
"is_active",
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Generated by Django 4.2.11 on 2025-07-10 06:51
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
("vacancy", "0008_vacancy_salary_alter_vacancy_required_experience_and_more"),
10+
]
11+
12+
operations = [
13+
migrations.AddField(
14+
model_name="vacancy",
15+
name="specialization",
16+
field=models.CharField(
17+
blank=True, max_length=128, null=True, verbose_name="Специализация"
18+
),
19+
),
20+
]

vacancy/models.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ class Vacancy(models.Model):
2828
"""
2929

3030
role = models.CharField(max_length=256, null=False)
31+
specialization = models.CharField(
32+
max_length=128,
33+
null=True,
34+
blank=True,
35+
verbose_name="Специализация"
36+
)
3137
required_skills = GenericRelation(
3238
"core.SkillToObject",
3339
related_query_name="vacancies",

vacancy/serializers.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ class Meta:
112112
fields = [
113113
"id",
114114
"role",
115+
"specialization",
115116
"required_skills",
116117
"required_skills_ids",
117118
"description",
@@ -139,6 +140,7 @@ class Meta:
139140
fields = [
140141
"id",
141142
"role",
143+
"specialization",
142144
"required_skills",
143145
"description",
144146
"is_active",
@@ -233,6 +235,7 @@ class Meta:
233235
fields = [
234236
"id",
235237
"role",
238+
"specialization",
236239
"required_skills",
237240
"required_skills_ids",
238241
"description",

0 commit comments

Comments
 (0)