feat(projects): add projects app's basic structure and endpoints
This commit is contained in:
68
apps/projects/admin.py
Normal file
68
apps/projects/admin.py
Normal file
@@ -0,0 +1,68 @@
|
||||
from django.contrib import admin
|
||||
|
||||
from core.admins.base import BaseAdmin
|
||||
from apps.projects.models import Project, ProjectMembership
|
||||
|
||||
|
||||
class ProjectMembershipInline(admin.TabularInline):
|
||||
model = ProjectMembership
|
||||
extra = 0
|
||||
autocomplete_fields = ("user",)
|
||||
|
||||
|
||||
@admin.register(Project)
|
||||
class ProjectAdmin(BaseAdmin):
|
||||
list_display = (
|
||||
"id",
|
||||
"name",
|
||||
"workspace",
|
||||
"client",
|
||||
"is_archived",
|
||||
"created_at",
|
||||
)
|
||||
|
||||
list_filter = (
|
||||
"workspace",
|
||||
"is_archived",
|
||||
"is_deleted",
|
||||
)
|
||||
|
||||
search_fields = (
|
||||
"name",
|
||||
"workspace__name",
|
||||
"client__name",
|
||||
)
|
||||
|
||||
autocomplete_fields = (
|
||||
"workspace",
|
||||
"client",
|
||||
)
|
||||
|
||||
inlines = (ProjectMembershipInline,)
|
||||
|
||||
|
||||
@admin.register(ProjectMembership)
|
||||
class ProjectMembershipAdmin(BaseAdmin):
|
||||
list_display = (
|
||||
"id",
|
||||
"project",
|
||||
"user",
|
||||
"role",
|
||||
"is_active",
|
||||
)
|
||||
|
||||
list_filter = (
|
||||
"role",
|
||||
"is_active",
|
||||
"is_deleted",
|
||||
)
|
||||
|
||||
search_fields = (
|
||||
"project__name",
|
||||
"user__mobile",
|
||||
)
|
||||
|
||||
autocomplete_fields = (
|
||||
"project",
|
||||
"user",
|
||||
)
|
||||
Reference in New Issue
Block a user