Thank you for your reply. Currently the restriction I need, in my particular case, is for string attributes only, but it would probably be useful in some cases for other types of attributes (dates, integers).
I'm not very knowledgeable about editing code, I'd rather wait for this feature to be included in a future SMW release. Do you think this is likely to happen ? -----Message d'origine----- De : S Page [mailto:[EMAIL PROTECTED] Envoyé : mardi 23 janvier 2007 23:13 À : LE DU Stefan - CETE Ouest/DIOG/Groupe A.N.T. Cc : semediawiki-user@lists.sourceforge.net; Ittay Dror Objet : Re: [Semediawiki-user] restricting possible values for a given attribute : possible ? LE DU Stefan - CETE Ouest/DIOG/Groupe A.N.T. wrote: > I'd like to know if it is possible, in SMW, to restrict the possible > values that a given attribute can take. Not in any released version, but Ittay Dror and myself have local patches for this, Mr. Dror sent his to this list on January 7th if you wish to edit your code. I will endeavor to compare them and synthesize the "best" for check in to Subversion. > e.g. : let's say I have a series of articles that I want to be tagged by > editors with an attribute of "color", and I want to only allow the > colors "blue" and "red". Would it be possible for me to set this > restriction on the "Attribute:color" article (with something like > [[Possible values::blue, red]], so that if an editor assigns the value > 'yellow' to the attribute "color" on an article, the factbox displays an > error message "oops, value 'yellow' not allowed for this attribute" ? Yes, that's the idea. Currently mine prints Oops! "yellow" is not in the list of possible values (blue, red) for this attribute Do you only want to restrict string attributes to particular values? It's also doable for other types of attributes like dates and integers, but I haven't seen any demand for this. Regards, -- =S Page ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Semediawiki-user mailing list Semediawiki-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/semediawiki-user