from django.contrib import admin

from .models import Project, Job, Task, ProjectWorker, UsedTaskTime


class ProjectAdmin(admin.ModelAdmin):
    list_display = ('id', 'name', 'start_dt', 'end_dt', 'sortkey')
    ordering = ['sortkey']

admin.site.register(Project, ProjectAdmin)


class JobAdmin(admin.ModelAdmin):
    list_display = ('id', 'name', 'sortkey', 'invalid')
    ordering = ['sortkey']

admin.site.register(Job, JobAdmin)


class TaskAdmin(admin.ModelAdmin):
    list_display = ('id', 'name', 'job', 'sortkey', 'invalid')
    ordering = ['sortkey']

admin.site.register(Task, TaskAdmin)


class ProjectWorkerAdmin(admin.ModelAdmin):
    list_display = ('id', 'user', 'project', 'job', 'invalid')
    list_filter = ['user', 'project', 'job']
    ordering = ['user', 'project', 'job']


admin.site.register(ProjectWorker, ProjectWorkerAdmin)


class UsedTaskTimeAdmin(admin.ModelAdmin):
    list_display = ('id', 'user', 'project', 'task')
    ordering = ['-id']

admin.site.register(UsedTaskTime, UsedTaskTimeAdmin)

@@ -908,32 +908,56 @@
 display = ('id',
+ 'taskdate', 'tasktime',
  'user', 'projec
@@ -968,16 +968,43 @@
 'task')%0A
+    list_filter = %5B'user'%5D%0A
     orde

add display column for admin.