I found that self.instance is set in super().init anyway
class BaseModelForm(BaseForm):
def __init__(self, data=None, files=None, auto_id='id_%s', prefix=None,
initial=None, error_class=ErrorList, label_suffix=None,
empty_permitted=False, instance=None, use_required_attribute=None,
renderer=None):
...
if instance is None:
# if we didn't get an instance, instantiate a new one
self.instance = opts.model()
https://github.com/django/django/blob/65e03a424e82e157b4513cdebb500891f5c78363/django/forms/models.py#L300
so we can track instance just before super().init called.
So my solution is to override init method and set custom field to track in all followed form's methods.
def __init__(self, *args: Any, instance=None, **kwargs: Any) -> None:
super().__init__(*args, instance=instance, **kwargs)
self.is_new_instance = not bool(instance)
and usage:
def _any_form_method(self):
if self.is_new_instance: