from django.contrib import admin
from .models import *


# Register your models here.

class RequirementInline(admin.TabularInline):
    model = ProjectRequirement
    extra = 1  


class FileInline(admin.TabularInline):
    model = ProjectFile
    extra = 1  

class CredentialInline(admin.TabularInline):
    model = ProjectCredential
    extra = 1  

class ProjectAdmin(admin.ModelAdmin):
    inlines=[RequirementInline, FileInline, CredentialInline]



class PointAdmin(admin.ModelAdmin):
    list_display = ('text', 'status', 'task', 'task__asigned_to')  # Display these fields in the admin list view
    list_filter = ('status',)

admin.site.register(Reference)
admin.site.register(Business)
admin.site.register(CustomerProfile)
admin.site.register(StaffProfile)
admin.site.register(ProjectType)
admin.site.register(Project, ProjectAdmin)
admin.site.register(Milestone)
admin.site.register(Epic)
admin.site.register(Note)
admin.site.register(Task)
admin.site.register(Status)
admin.site.register(Tag)
admin.site.register(Point, PointAdmin)
admin.site.register(DailyReport)
admin.site.register(BusinessType)
admin.site.register(PointActivity)
admin.site.register(Connection)

