[Product-Developers] Remove dashes from shortname - override choosename in namechooser.py?

Giacomo Spettoli giacomo.spettoli at gmail.com
Thu Jul 28 07:43:33 UTC 2011


On 28/07/2011 01:23, imran.azad wrote:
> Hi Giacomo,
>
> Thank you for your response. I have managed to register the local utility,
> I'm just not sure how to set it up in the class: This is what I have so far:
>
> class Test(interface.Interface):
>      def normalize(self):
>          return self.title
>
> However, I get the following error:
> Traceback (innermost last):
>    Module ZPublisher.Publish, line 127, in publish
>    Module ZPublisher.mapply, line 77, in mapply
>    Module ZPublisher.Publish, line 47, in call_object
>    Module plone.z3cform.layout, line 64, in __call__
>    Module plone.z3cform.layout, line 54, in update
>    Module plone.z3cform.fieldsets.extensible, line 59, in update
>    Module plone.z3cform.patch, line 30, in GroupForm_update
>    Module z3c.form.group, line 138, in update
>    Module z3c.form.action, line 99, in execute
>    Module z3c.form.button, line 311, in __call__
>    Module z3c.form.button, line 170, in __call__
>    Module plone.dexterity.browser.add, line 93, in handleAdd
>    Module z3c.form.form, line 247, in createAndAdd
>    Module plone.dexterity.browser.add, line 72, in add
>    Module plone.dexterity.utils, line 142, in addContentToContainer
>    Module plone.app.content.namechooser, line 49, in chooseName
>    Module plone.i18n.normalizer.adapters, line 62, in normalize
> AttributeError: normalize
>
> --
> View this message in context: http://plone.293351.n2.nabble.com/Remove-dashes-from-shortname-override-choosename-in-namechooser-py-tp6627262p6628133.html
> Sent from the Product Developers mailing list archive at Nabble.com.
> _______________________________________________
> Product-Developers mailing list
> Product-Developers at lists.plone.org
> https://lists.plone.org/mailman/listinfo/plone-product-developers
Hi,
    you could take inspiration from here:
plone.i18n-2.0-py2.6.egg/plone/i18n/normalizer/__init__.py

Just extend the original class and override your method.

Giacomo



-- 
Giacomo Spettoli

twitter: http://twitter.com/giacomospettoli
linkedin: http://linkedin.com/in/giacomospettoli
company site: http://redomino.com
blog: http://www.spettoli.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.plone.org/pipermail/plone-product-developers/attachments/20110728/83246b5b/attachment-0001.html>


More information about the Product-Developers mailing list