You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For to_python(), if anything goes wrong during value conversion, you should raise a ValidationError exception.
I discover this error making a ModelForm from a model that included a VersionField field. Raising a ValueError makes the form crash instead of handle the error gracefully.
The text was updated successfully, but these errors were encountered:
VersionField and SpecField both raise a ValueError exception when an incorrect value is passed to Version constructor or BaseSpec.parse function.
The documentation in django for create custom models fields says https://docs.djangoproject.com/en/5.0/howto/custom-model-fields/#converting-values-to-python-objects:
I discover this error making a ModelForm from a model that included a VersionField field. Raising a ValueError makes the form crash instead of handle the error gracefully.
The text was updated successfully, but these errors were encountered: