Skip to content

Commit

Permalink
Merge pull request #39 from SADiLaR/feature/alphabetical-order-lists
Browse files Browse the repository at this point in the history
added ordering to admin
  • Loading branch information
daniel-gray-tangent authored May 6, 2024
2 parents 835f688 + 57ca99c commit c68c4fb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/general/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,22 @@ def clean(self):


class DocumentFileAdmin(SimpleHistoryAdmin):
ordering = ["title"]
list_display = ["title", "license", "document_type", "available"]
ordering = ["license"]
search_fields = ["title", "license", "document_type"]
form = DocumentFileForm
history_list_display = ["title", "license", "document_type", "available"]


class SubjectAdmin(SimpleHistoryAdmin):
ordering = ["name"]
search_fields = ["name"]
list_display = ["name"]
history_list_display = ["name"]


class LanguageAdmin(SimpleHistoryAdmin):
ordering = ["name"]
history_list_display = ["name", "iso_code"]
list_display = ["name", "iso_code"]

Expand All @@ -68,12 +70,14 @@ class ProjectAdminInline(admin.TabularInline):


class ProjectAdmin(SimpleHistoryAdmin):
ordering = ["name"]
search_fields = ["name"]
list_display = ["name"]
history_list_display = ["name"]


class InstitutionAdmin(SimpleHistoryAdmin):
ordering = ["name"]
search_fields = ["name"]
list_display = ["name"]
inlines = [ProjectAdminInline]
Expand Down
1 change: 1 addition & 0 deletions app/users/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

class CustomUserAdmin(UserAdmin, SimpleHistoryAdmin):
model = CustomUser
ordering = ["username"]
list_display = [
"username",
"email",
Expand Down

0 comments on commit c68c4fb

Please sign in to comment.