db.models.Model.validate_unique()

Model.validate_unique(exclude=None) [source]

This method is similar to clean_fields(), but validates all uniqueness constraints on your model instead of individual field values. The optional exclude argument allows you to provide a list of field names to exclude from validation. It will raise a ValidationError if any fields fail validation.

Note that if you provide an exclude argument to validate_unique(), any unique_together constraint involving one of the fields you provided will not be checked.

doc_Django
2016-10-09 18:35:55
Comments
Leave a Comment

Please login to continue.