<reponame>DiceNameIsMy/recruiting
from django.contrib import admin

from .models import KeySkill, Vacancy, Resume, Experience, Respond


class ResumeInline(admin.StackedInline):
    model = Resume
    extra = 0

class RespondInline(admin.StackedInline):
    model = Respond
    extra = 0

class ExperienceInline(admin.StackedInline):
    model = Experience
    extra = 0


@admin.register(KeySkill)
class KeySkillAdmin(admin.ModelAdmin):
    search_fields = ['title']

@admin.register(Vacancy)
class VacancylAdmin(admin.ModelAdmin):
    list_display = ('header', 'employer', 'region', 'salary', 'employment', 'schedule')
    list_filter = ('region', 'employment', 'schedule')

    

@admin.register(Resume)
class ResumelAdmin(admin.ModelAdmin):
    list_display = ('applicant', 'header', 'education', 'is_open')
    empty_value_display = 'deleted'
    
    inlines = (
        ExperienceInline, RespondInline,
    )

@admin.register(Experience)
class ExperienceAdmin(admin.ModelAdmin):
    pass

@admin.register(Respond)
class RespondAdmin(admin.ModelAdmin):
    pass


from django.contrib import admin

from .models import KeySkill, Vacancy, Resume, Experience, Respond


class ResumeInline(admin.StackedInline):
    model = Resume
    extra = 0

class RespondInline(admin.StackedInline):
    model = Respond
    extra = 0

class ExperienceInline(admin.StackedInline):
    model = Experience
    extra = 0


@admin.register(KeySkill)
class KeySkillAdmin(admin.ModelAdmin):
    search_fields = ['title']

@admin.register(Vacancy)
class VacancylAdmin(admin.ModelAdmin):
    list_display = ('header', 'employer', 'region', 'salary', 'employment', 'schedule')
    list_filter = ('region', 'employment', 'schedule')

    

@admin.register(Resume)
class ResumelAdmin(admin.ModelAdmin):
    list_display = ('applicant', 'header', 'education', 'is_open')
    empty_value_display = 'deleted'
    
    inlines = (
        ExperienceInline, RespondInline,
    )

@admin.register(Experience)
class ExperienceAdmin(admin.ModelAdmin):
    pass

@admin.register(Respond)
class RespondAdmin(admin.ModelAdmin):
    pass