f-base here.
>
> Take a look at:
> http://docs.djangoproject.com/en/dev/ref/contrib/admin/#adding-custom-validation-to-the-admin
>
> You can do multi-field validation by adding a clean() method that will
> run after every clean_FIELDNAME() method, and can do any checking you
> need,
b/admin/#adding-custom-validation-to-the-admin
You can do multi-field validation by adding a clean() method that will
run after every clean_FIELDNAME() method, and can do any checking you
need, and raise a ValidationError if it fails.
-Jeff
On Nov 25, 4:29 am, "Alessandro Ronchi" <[EMA
It's not possible to validate a model in admin checking multiple forms
conditions?
is there any example or code snippet ?
--
Alessandro Ronchi
Skype: aronchi
http://www.alessandroronchi.net
SOASI Soc.Coop. - www.soasi.com
Sviluppo Software e Sistemi Open Source
Sede: Via Poggiali 2/bis, 47100 F
I was finally able to figure it out as I saw on another post. Instead, of
using the RaiseValidation error I did the following:
self.errors.update(annotation=ErrorList([u'You must enter an Annotation
Type.']))
Thanks for all your help,
Jeff
-- Original message --
From:
On Aug 9, 7:34 pm, [EMAIL PROTECTED] wrote:
> So, if I use clean_annotationvalue to do both how would I be able to put an
> error
> message on the annotation type ...
I think you were on the right track the first time. Philosophically,
the Form's clean() method is where you're supposed to be do
Reverse the field order in the form, otherwise not that I'm aware of.
--~--~-~--~~~---~--~~
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 unsub
So, if I use clean_annotationvalue to do both how would I be able to put an
error
message on the annotation type when a value is entered but no annotation type
is entered.
Wouldn't that error message appear under the annotationvalue field
Jeff
-- Original message --
Fro
The clean_foo functions are run in order.
So in your situation, clean_annotationtype will only have access to
the annotationtype value, but clean_annotationvalue will be able to
see both, since clean_annotationtype has already been run.
--~--~-~--~~~---~--~~
You
I have run across an issue trying to implement the clean method.
I have 2 fields an annotation type and annotation value. I am trying
to validate that if one
value is entered the other value cannot be blank or empty.
Initially, I tried to implement the clean method at the field level.
The proble
9 matches
Mail list logo