Yes, validators are for form input, but you can have them applied to 
regular inserts and updates by using validate_and_insert() and 
validate_and_update() in place of insert() and update().

Anthony

On Thursday, December 1, 2011 9:07:07 AM UTC-5, Manakel wrote:
>
> Hello,
>
> Here is the use case. I have 2 Entities A & B (Models) that can be
> linked together using a m2m relationships in a "link" table. the 2
> Entities each have a 'category' field and there are some business
> rules like
> Items of A with category C1 are not allowed to be linked to Items of B
> with category C2
>
> Now i need to ensure that, whatever the view / controller used to
> attempt to create the new link, my central validation get a chance to
> accept or refuse the creation of Links .
>
> I was thinking that i need a custom validator, but i had the feeling
> that custom validator are only for form and not for models?
>
>

Reply via email to