5d06d4d3ce
Co-authored-by: Cursor <cursoragent@cursor.com>
48 lines
1.8 KiB
Python
48 lines
1.8 KiB
Python
from django.contrib import admin
|
|
from unfold.admin import ModelAdmin
|
|
|
|
from apps.hiring.models import HiringRequest, InternAccount, Vacancy
|
|
|
|
|
|
@admin.register(InternAccount)
|
|
class InternAccountAdmin(ModelAdmin):
|
|
list_display = ['label', 'username', 'is_active', 'assigned_to', 'updated_at']
|
|
list_filter = ['is_active']
|
|
search_fields = ['label', 'username']
|
|
list_select_related = ['assigned_to']
|
|
ordering = ['label']
|
|
readonly_fields = ['assigned_to', 'created_at', 'updated_at', 'uuid']
|
|
|
|
|
|
@admin.register(Vacancy)
|
|
class VacancyAdmin(ModelAdmin):
|
|
list_display = [
|
|
'title', 'status', 'priority', 'pharmacy', 'department',
|
|
'candidates_count', 'opened_at', 'created_by',
|
|
]
|
|
list_filter = ['status', 'priority', 'user_location_type']
|
|
search_fields = ['title', 'description']
|
|
list_select_related = ['post', 'pharmacy', 'department', 'location', 'created_by']
|
|
ordering = ['-opened_at', '-created_at']
|
|
readonly_fields = ['created_at', 'updated_at', 'uuid']
|
|
|
|
|
|
@admin.register(HiringRequest)
|
|
class HiringRequestAdmin(ModelAdmin):
|
|
class Media:
|
|
js = ('assets/js/phone-format.js',)
|
|
|
|
list_display = [
|
|
'last_name', 'first_name', 'status', 'employment_type', 'hire_date', 'trial_days',
|
|
'requested_by', 'granted_ticket', 'created_at',
|
|
]
|
|
list_filter = ['status', 'user_location_type', 'employment_type']
|
|
search_fields = ['last_name', 'first_name', 'middle_name', 'candidate_email', 'inn_code']
|
|
list_select_related = [
|
|
'requested_by', 'decision_by', 'employee', 'post', 'department',
|
|
'user_pharmacy', 'user_location', 'granted_ticket',
|
|
]
|
|
filter_horizontal = ['requested_access']
|
|
ordering = ['-created_at']
|
|
readonly_fields = ['issued_password', 'created_at', 'updated_at', 'uuid']
|