Aljosa Mohorovic wrote:
> On Aug 18, 5:13 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
> wrote:
>> "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 o
On Aug 18, 5:13 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> "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 fie
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
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.
also, i'm looking for clean method example where i can raise
validation errors for 2 or more fields based on single validation.
something like:
if custom_validation() == False:
# rais
if i have a MainModel:
class MainModel(models.Model):
[...]
mymodel = models.ForeignKey(MyModel)
and MainModelForm:
class MainModelForm(forms.ModelForm):
def clean_somefield(self):
# here i need to get mymodel for current form to validate
something
somewhere in views i have:
mainmod
5 matches
Mail list logo