Skip to content
Discussion options

You must be logged in to vote

The reason the first way of doing it is raising a ValidationError is an edgecase as the custom field type netbox uses for that field does validation when converting values:

raise ValidationError("Invalid IP address format: {}".format(value))

In general, when not running full_clean, none of the following methods are run:

https://docs.djangoproject.com/en/5.0/ref/models/instances/#django.db.models.Model.full_clean

You have to always call full_clean, as this is how it works both in the API and the UI. Not doing…

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
3 replies
@llamafilm
Comment options

@llamafilm
Comment options

@candlerb
Comment options

Answer selected by llamafilm
Comment options

You must be logged in to vote
3 replies
@DanSheps
Comment options

@llamafilm
Comment options

@candlerb
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants