Disable has_changed() check in django form

Viewed 45

When an entry is saved in the results list in django admin site I need it to end up in save_model regardless of whether it has changed or not. With default behaviour, it will just present the same page if there are no changes.

What is the canonical way of disabling it? Currently, I came up with this quick and dirty snippet. It works, but I suspect it's ugly:)

def get_changelist_form(self, request, **kwargs):
    res=super().get_changelist_form(request, **kwargs)
    # Ugly?
    res.has_changed=lambda *args, **kwargs: True
    return res
0 Answers
Related