[Plone-IT] PloneFormGen: override validator

annaluce banjo a tiscali.it
Ven 16 Ott 2009 10:01:43 UTC




annaluce wrote:
> 
> come faccio a validare un campo in funzione del valore di un altro.
> ad esempio come faccio a rendere obbligatorio il numero matricola solo se
> studente universitario?
> 

ok dopo aver creato 2 string field testo1 e testo2 e lo script prova come
segue:

if context.REQUEST.get('testo1').startswith('pippo'):
    return False
else:
    return 'errore'

se inserisco nell'override validator di testo2
folder/prova funziona
mentre python: folder.prova non funziona.

come faccio allora ad inserire pualcosa tipo
python: test(value == '' or folder.prova=='errore','Errore',False)
-- 
View this message in context: http://n2.nabble.com/PloneFormGen-override-validator-tp3828647p3834662.html
Sent from the Plone - Italy mailing list archive at Nabble.com.




Maggiori informazioni sulla lista Plone-IT