Re: Validate single field in model

2010-11-02 Thread Jirka Vejrazka
> But can i do something similar in the Model itself ? Hi, have you checked the documentation? http://docs.djangoproject.com/en/dev/ref/models/instances/#validating-objects Cheers Jirka -- You received this message because you are subscribed to the Google Groups "Django users"

Validate single field in model

2010-11-02 Thread Jakob Olsen
Hello, I try to validate a single field in a model. I know I can validate the field in a ModelForm like: def clean_FIELDNAME(self): if self == 'This is a test': raise forms.ValidationError("ValidationError") But can i do something similar in the Model itself ? -- You received this