add new app
This commit is contained in:
1
core/apps/projects/admin/__init__.py
Normal file
1
core/apps/projects/admin/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from .project import *
|
||||
21
core/apps/projects/admin/project.py
Normal file
21
core/apps/projects/admin/project.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from django.contrib import admin
|
||||
|
||||
from core.apps.projects.models.project import ProjectDepartment, Project
|
||||
|
||||
|
||||
class ProjectDepartmentInline(admin.TabularInline):
|
||||
model = ProjectDepartment
|
||||
extra = 0
|
||||
|
||||
|
||||
@admin.register(Project)
|
||||
class ProjectAdmin(admin.ModelAdmin):
|
||||
list_display = ['name', 'location', 'start_date', 'end_date']
|
||||
search_fields = ['name']
|
||||
inlines = [ProjectDepartmentInline]
|
||||
|
||||
|
||||
@admin.register(ProjectDepartment)
|
||||
class ProjectDepartmentAdmin(admin.ModelAdmin):
|
||||
list_display = ['name', 'project']
|
||||
search_fields = ['name']
|
||||
Reference in New Issue
Block a user