-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the TestEvent model to Django admin
Make the string representation of TestEvent simpler
- Loading branch information
1 parent
d5ad27b
commit daf0d04
Showing
2 changed files
with
43 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,43 @@ | ||
# Register your models here. | ||
from django.contrib import admin | ||
|
||
from .models import TestEvent | ||
|
||
|
||
class TestEventAdmin(admin.ModelAdmin): | ||
list_display = ( | ||
"date_display", | ||
"date_edtf_direct", | ||
"date_earliest", | ||
"date_latest", | ||
"date_sort_ascending", | ||
"date_sort_descending", | ||
"date_edtf", | ||
) | ||
search_fields = ("date_display", "date_edtf_direct") | ||
list_filter = ("date_earliest", "date_latest") | ||
readonly_fields = ( | ||
"date_earliest", | ||
"date_latest", | ||
"date_sort_ascending", | ||
"date_sort_descending", | ||
"date_edtf", | ||
) | ||
|
||
fieldsets = ( | ||
(None, {"fields": ("date_display", "date_edtf_direct", "date_edtf")}), | ||
( | ||
"Computed Dates", | ||
{ | ||
"classes": ("collapse",), | ||
"fields": ( | ||
"date_earliest", | ||
"date_latest", | ||
"date_sort_ascending", | ||
"date_sort_descending", | ||
), | ||
}, | ||
), | ||
) | ||
|
||
|
||
admin.site.register(TestEvent, TestEventAdmin) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters