Closed AntoninGrele closed 1 year ago
Hmmm .. I miss something.
Code below checks variable title_method
is callable (aka function). getattr checks class has title_method_name
. By default class hasn't method with title_method_name
-> If title_method
is not callable or None method _get_custom_title
return None
title_method = getattr(model_admin, title_method_name, None)
if not callable(title_method):
return None
Hello,
By default, the ListFilter class from which DateRangeFilter inherits has a
title
attribute ofNone
, which can be overriden by setting a different title in the inheriting class.Unfortunately, I can't use this feature when inheriting from DateRangeFilter because of this :
If the
_get_custom_title
method returns something, then theself.title
is overriden by that result.But the
_get_custom_title
method always returns a result, as we can see here:So DateRangeFilter will always override the title. The _get_custom_title function should return None if there's no custom titel method, no ?