Then yes, in the clean() method of your Galeria form, you could check the
number of fotos present and then raise a ValidationError if it is too many,
along with a custom message for the user.

Is that what you wish to do?

On Mon, Dec 6, 2010 at 5:18 AM, Daniel Carvalho <[email protected]> wrote:

> On 12/06/2010 03:05 AM, Wayne Smith wrote:
> > It's hard to say, because I don't know what kind of "validation" or
> business
> > logic regarding it you are trying to accomplish/employ.
> >
>
>
> suppose I want a validation like this:
>
> the number of fotos in a galeria should be limited to a number, which
> depends on the user that created it (OR, depends on some values that are
> in the galeria object)
>
>
>
> > However, if you are wanting to ensure you validate a foto during a
> gallery
> > save, why not call an overridden fotos.save() from your custom
> > galeria.save()?
> >
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to