django-bootstrap3-datetimepicker icon indicating copy to clipboard operation
django-bootstrap3-datetimepicker copied to clipboard

RemovedInDjango20Warning: `DateTimePicker._format_value` is deprecated, use `format_value` instead.

Open dtomas opened this issue 7 years ago • 2 comments

The deprecation warning for DateTimePicker._format_value is still issued even though the method has been overridden. Seems to be due to the metaclass (RenameMethodsBase) wrapping it at class creation time. Extending the metaclass and setting renamed_methods = () does not work, because all base classes are traversed, so their renamed_methods get added as well.

This is a problem when treating warnings as errors, i.e. to check for Django 2.0 forward compatibility of a project using Django 1.x.

dtomas avatar Sep 17 '18 17:09 dtomas

Quick fix:

if hasattr(DateTimePicker, 'format_value'):
    DateTimePicker._format_value = DateTimePicker.format_value

dtomas avatar Sep 18 '18 07:09 dtomas

PR welcome:)

tomhamiltonstubber avatar Oct 10 '18 11:10 tomhamiltonstubber