I want to return these error messages to the html form and show where are wrong with this form.Is there a solution?Or maybe I should use raw SQL queries?Thanks for any advice.
For example:
models.py:
class GeneticCharacter(models.Model):
StrainNo=models.CharField(max_length=10,primary_key=True)
StrainName=models.CharField(max_length=10)
SourceNo=models.IntegerField()
ESBL=models.CharField(max_length=9,blank=True)
AEM=models.CharField(max_length=12,blank=True)
PMQR=models.CharField(max_length=15,blank=True)
ISeq=models.CharField(max_length=12,blank=True)
Replicon=models.CharField(max_length=10,blank=True)
MLST_type=models.CharField(max_length=10,blank=True)
PLG_type=models.CharField(max_length=2,blank=True)
IsPat=models.BooleanField()
views.py
...
obj=GeneticCharacter()
obj.ESBL="a"*20
obj.AEM="a"*20
obj.save()
...
How can I catch all the exceptions?