1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- from django.contrib import admin
- from models import Project, Task, Risk, Issue, Status
- # Register your models here.
- class TaskAdmin(admin.ModelAdmin):
- list_display = (
- 'title',
- 'project',
- 'status',
- 'start',
- 'end',
- )
- ordering = ['start']
- list_filter = ['start', 'status']
- class TaskInline(admin.TabularInline):
- model = Task
- extra=0
- class RiskAdmin(admin.ModelAdmin):
- list_display = [
- 'name',
- 'project',
- 'impact',
- 'status',
- ]
- ordering = [
- 'project',
- '-impact',
- ]
- list_filter = [
- 'project',
- 'status',
- 'impact',
- ]
- class RiskInline(admin.StackedInline):
- model = Risk
- extra=0
- class IssueAdmin(admin.ModelAdmin):
- list_display = (
- 'name',
- 'project',
- 'severity',
- 'status',
- )
- ordering = ['project', '-severity']
- list_filter = ['project', 'status']
- class IssueInline(admin.StackedInline):
- model = Issue
- extra=0
- class StatusAdmin(admin.ModelAdmin):
- list_display = (
- 'date',
- 'project',
- 'cost',
- 'time',
- 'quality',
- )
- ordering = ['project','date']
- list_filter = ['project', 'cost', 'time', 'quality']
- class StatusInline(admin.TabularInline):
- model = Status
- extra=0
- class ProjectAdmin(admin.ModelAdmin):
- list_display = (
- 'name',
- )
- inlines = [
- StatusInline,
- RiskInline,
- IssueInline,
- TaskInline,
- ]
- admin.site.register(Task, TaskAdmin)
- admin.site.register(Risk, RiskAdmin)
- admin.site.register(Issue, IssueAdmin)
- admin.site.register(Status, StatusAdmin)
- admin.site.register(Project, ProjectAdmin)
|