Skip to content

Commit

Permalink
Merge pull request #29 from ppfeufer/development
Browse files Browse the repository at this point in the history
let's implement all methods, shall we ...
  • Loading branch information
ppfeufer authored Sep 28, 2020
2 parents 760f9e8 + 1aaeb9a commit 37f3a18
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions afat/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,31 @@
from .models import AFat, AFatLink, AFatLinkType


def custom_filter_title(title):
def custom_filter(title):
"""
defining custom filter titles
:param title:
:return:
"""

class Wrapper(admin.FieldListFilter):
"""
Wrapper
"""

def expected_parameters(self):
"""
expected parameters
"""
pass

def choices(self, changelist):
"""
choices
:param changelist:
"""
pass

def __new__(cls, *args, **kwargs):
instance = admin.FieldListFilter.create(*args, **kwargs)
instance.title = title
Expand Down Expand Up @@ -39,7 +62,7 @@ class AFatLinkAdmin(admin.ModelAdmin):

list_filter = (
"is_esilink",
("link_type__name", custom_filter_title("fleet type")),
("link_type__name", custom_filter(title="fleet type")),
)

ordering = ("-afattime",)
Expand Down

0 comments on commit 37f3a18

Please sign in to comment.