[Product-Developers] Remove dashes from shortname - override choosename in namechooser.py?
giacomo.spettoli at gmail.com
Wed Jul 27 22:13:29 UTC 2011
Il 27/07/2011 20:34, imran.azad ha scritto:
> I want to remove the dashes from the shortname of the object. In other words
> I want to remove all dashes in the id of an object. I have noticed there is
> a function in namechooser.py called chooseName which does the following:
> name = getUtility(IURLNormalizer).normalize(name)
> if I set the variable to:
> name = name
> It works! And the dashes aren't added. However this approach is modifying
> the Plone Core :-(
> I want to avoid doing this, I would rather like to override the chooseName
> How can I do this from my class(custom content type using Dexterity)
> Thank You
> View this message in context: http://plone.293351.n2.nabble.com/Remove-dashes-from-shortname-override-choosename-in-namechooser-py-tp6627262p6627262.html
> Sent from the Product Developers mailing list archive at Nabble.com.
> Product-Developers mailing list
> Product-Developers at lists.plone.org
you can customize the behaviour of name normalization by registering
a local utility that implements IURLNormalizer interface.
Read more here:
company site: http://redomino.com
More information about the Product-Developers