On Mon, 2008-08-18 at 08:05 -0700, Aljosa Mohorovic wrote:
> i currently use self.instance but i'm not sure if i can do that since
> i didn't find an example using it in docs.

There are a few parts of model forms that aren't (re-)documented in the
docs. Reading the code and docstrings is a good way to look at what's
possible there. From having a quick read of the code, self.instance
looks like the right thing.

> also, i'm looking for clean method example where i can raise
> validation errors for 2 or more fields based on single validation.

"2 or more fields" is a signal that the clean() method on the form is
the right place to do this. At that point, all the fields will have
individually passed their validation (i.e. they will be of the right
type) and any fields which didn't pass will not be in self.cleaned_data.

Regards,
Malcolm



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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