Re: Form validation vs. DRY

2013-07-03 Thread Roman Klesel
2013/7/3 Tomas Ehrlich : > you can use model validation > https://docs.djangoproject.com/en/dev/ref/models/instances/#validating-objects This sounds very good! :-) Thanks! -- You received this message because you are subscribed to the Google Groups "Django users"

Re: Form validation vs. DRY

2013-07-03 Thread Tomas Ehrlich
Hi Roman, you can use model validation https://docs.djangoproject.com/en/dev/ref/models/instances/#validating-objects It works similar to form validation. After, when you create ModelForm, it will take validation rules from model. All these validations should be called outside save() Cheers,

Form validation vs. DRY

2013-07-03 Thread Roman Klesel
Hello, I'm programming a database front end. In many cases I want to constrain the data written to the database. Therefore I implement some checks either through real database constraints or trough some logic in the model, so it will throw an exception when the constraints are not met. e.g.: