Skip to content

Commit

Permalink
QOL: add a few more search/ordering fields
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonLovesDoggo committed Dec 21, 2023
1 parent 6b3453f commit d3a9c56
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions core/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,15 @@ class LogicPuzzleAdmin(admin.ModelAdmin):
class TeamAdmin(admin.ModelAdmin):
readonly_fields = ("path",)
inlines = [InviteInLine, TeamMemberInline]
search_fields = ("name", "members__username")
search_fields = ("name", "members__username", "members__first_name", "members__last_name")
list_display = ("name", "hunt", "current_qr_i", "member_count",)
list_filter = ("hunt__name",)

ordering = ("hunt", "current_qr_i",)

@staticmethod
def member_count(obj):
return obj.members.count()

@admin.display(description="The path that the team has/completed")
def path(self, team):
lines = []
Expand Down Expand Up @@ -141,6 +147,7 @@ class UserAdmin(UserAdmin_):
"first_name",
"last_name",
"email",
"current_team",
)
actions = [
set_as_logic_setter,
Expand Down

0 comments on commit d3a9c56

Please sign in to comment.