from django import forms


class LinkModelChoiceField(forms.ModelChoiceField):
    def to_python(self, value):
        if value is not None and value.isdigit():
            return super().to_python(value)

        return value
