Skip to content

Commit

Permalink
feat: added search fields to admin
Browse files Browse the repository at this point in the history
  • Loading branch information
Dhruv9449 committed Apr 28, 2024
1 parent d5186bf commit 0b9c04f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions student_welfare_backend/student_welfare_backend/core/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class OrganizationAdmin(admin.ModelAdmin):
"sub_type",
]
list_filter = ["type", "sub_type"]
search_fields = ["name", "type", "sub_type"]


@admin.register(UserOrganizationRelation)
Expand All @@ -29,6 +30,7 @@ class UserOrganizationRelationAdmin(admin.ModelAdmin):
"position"
]
list_filter = ["role", "position"]
search_fields = ["user__name", "organization__name", "role", "position"]


@admin.register(Event)
Expand All @@ -43,6 +45,7 @@ class EventAdmin(admin.ModelAdmin):
"end_time",
]
list_filter = ["organizing_body"]
search_fields = ["name", "organizing_body__name"]


@admin.register(Spotlight)
Expand All @@ -56,6 +59,7 @@ class SpotlightAdmin(admin.ModelAdmin):
"hightlight_type",
]
list_filter = ["name", "hightlight_type"]
search_fields = ["name", "hightlight_type"]


@admin.register(Newsletter)
Expand All @@ -69,6 +73,7 @@ class NewsletterAdmin(admin.ModelAdmin):
"link"
]
list_filter = ["year", "month"]
search_fields = ["year", "month"]


@admin.register(FAQ)
Expand All @@ -81,6 +86,7 @@ class FAQAdmin(admin.ModelAdmin):
"answer"
]
search_fields = ["question", "answer"]
ordering = ["question"]


@admin.register(SpecialFile)
Expand Down

0 comments on commit 0b9c04f

Please sign in to comment.