Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
thalia
concrexit
Commits
7c529624
Verified
Commit
7c529624
authored
Sep 25, 2018
by
Sébastiaan Versteeg
Browse files
Add sorting to custom columns in event admin
parent
c77b1407
Changes
1
Hide whitespace changes
Inline
Side-by-side
website/events/admin.py
View file @
7c529624
...
...
@@ -131,6 +131,7 @@ class EventAdmin(DoNextModelAdmin):
event_date
=
timezone
.
make_naive
(
obj
.
start
)
return
_date
(
event_date
,
"l d b Y, G:i"
)
event_date
.
short_description
=
_
(
'Event Date'
)
event_date
.
admin_order_field
=
'start'
def
registration_date
(
self
,
obj
):
if
obj
.
registration_start
is
not
None
:
...
...
@@ -140,6 +141,7 @@ class EventAdmin(DoNextModelAdmin):
return
_date
(
start_date
,
"l d b Y, G:i"
)
registration_date
.
short_description
=
_
(
'Registration Start'
)
registration_date
.
admin_order_field
=
'registration_start'
def
edit_link
(
self
,
obj
):
return
_
(
'Edit'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment