How to validate fields of a form in django by consulting its existence in the database (eg: the ID of a record)
How to validate fields of a form in django by consulting its existence in the database (eg: the ID of a record)
you can put the attribute of your model the following unique=True
, something like this:
id = models.CharField(blank=False, null=False, unique=True)
, with this django it verifies if in the database exists some object created with this id