Bonjour,
Bonjour vous devez modifier le validor associé à title dans le schema
ex :
schema['title'].validators = list(tuple(schema['title'].validators) +
[monInstanceDeValidator])
Ou ajouter une fonction post_validate dans la classe
ex pour une classe s'appelant EPRIVR_Workspace et ayant pour domaine
extranetprivr j'ai ajouté dans EPRIVR_Workspace.py
security.declarePublic('post_validate')
def post_validate(self,REQUEST,errors):
"""
Check if a workspace with same title already exist
"""
if not REQUEST or not REQUEST.has_key('title') :
return
title = REQUEST['title']
parent = self.getParentNode()
for w in parent.objectValues(('EPRIVR_Workspace',)) :
if w != self and w.Title() == title :
errors['title'] =
self.translate('error_title_already_in_use', domain='extranetprivr')
break
Cordialement
--
Michaël Launay
Gérant d'Ecréall
24, rue des Pâquerettes
59155 Faches Thumesnil
tél : 09 50 88 00 07
mob : 06 16 85 91 12
Fax : 09 56 88 00 07
Le mardi 06 mai 2008 à 16:35 +0200, Thomas van Oudenhove a écrit :
> bonjour,
>
> je cherche à interdire à l'utilisateur de saisir un titre qui existe déjà pour
> un objet de type 'Bookmark Folder' (add-on product tasty-bookmarks).
>
> j'ai essayé de mettre des modifs dans le code de ATBookmarks.py (dans
> plone_home/zinstance/products/ATBookmark/) mais je ne constate aucun effet
> sur l'utilisation...
>
> quelqu'un aurait-il une idée de l'endroit (fichier dans le fs, dans la
> zmi,...) où je pourrais faire cette modification ?
>
> merci beaucoup,
>
> ps: plone v3.1 (RC) et tasty bookmarks v1.7.2
>
_______________________________________________
Plone-FR mailing list
[hidden email]
http://lists.plone.org/mailman/listinfo/plone-fr