Re: Raise field error in models clean method

2013-05-20 Thread Jani Tiainen
On Sun, 19 May 2013 06:38:50 -0700 (PDT) Kai Schlamp wrote: > Hello. > > How to raise a `ValidationException` in the models `clean` method? > > def clean(self): > from django.core.exceptions import ValidationError > raise ValidationError({'title': 'not ok'}) > > The above d

Raise field error in models clean method

2013-05-19 Thread Kai Schlamp
Hello. How to raise a `ValidationException` in the models `clean` method? def clean(self): from django.core.exceptions import ValidationError raise ValidationError({'title': 'not ok'}) The above does not add the error to the `title` field (when using a form), but to the non