Discussion:
[Zope3-dev] Better default namechooser
Christian Zagrodnick
2007-10-11 14:53:26 UTC
Permalink
Hey,

I constantly run into the fact that the default namechooser in Zope 3
is too dumb.

Does anybody object in making it a little more smart? That is:

* replace all non us-ascii and otherwise harmful chars by something
useful (base-form or alike)
* replace spaces by - or _
--
Christian Zagrodnick

gocept gmbh & co. kg ? forsterstrasse 29 ? 06112 halle/saale
www.gocept.com ? fon. +49 345 12298894 ? fax. +49 345 12298891
Sidnei da Silva
2007-10-11 15:02:08 UTC
Permalink
Post by Christian Zagrodnick
Hey,
I constantly run into the fact that the default namechooser in Zope 3
is too dumb.
* replace all non us-ascii and otherwise harmful chars by something
useful (base-form or alike)
* replace spaces by - or _
I suggest looking (and using!) at plone.i18n.normalizer, just an
'easy_install' away:

http://api.plone.org/Plone/3.0/public/src/plone.i18n/plone/i18n/plone.i18n.normalizer.tests.test_normalizer-module.html
--
Sidnei da Silva
Enfold Systems http://enfoldsystems.com
Fax +1 832 201 8856 Office +1 713 942 2377 Ext 214
Oliver Marx
2007-10-11 15:13:03 UTC
Permalink
Been looking for something like that for some time.
I would love to use more of the stuff from the plone repos.
But it is all gpl which makes it a no go.
Maybe the Plone dudes could start to use lgpl for the zope 3 components
they develop?
Post by Sidnei da Silva
Post by Christian Zagrodnick
Hey,
I constantly run into the fact that the default namechooser in Zope 3
is too dumb.
* replace all non us-ascii and otherwise harmful chars by something
useful (base-form or alike)
* replace spaces by - or _
I suggest looking (and using!) at plone.i18n.normalizer, just an
http://api.plone.org/Plone/3.0/public/src/plone.i18n/plone/i18n/plone.i18n.normalizer.tests.test_normalizer-module.html
Philipp von Weitershausen
2007-10-12 09:23:20 UTC
Permalink
I constantly run into the fact that the default namechooser in Zope 3 is
too dumb.
* replace all non us-ascii and otherwise harmful chars by something
useful (base-form or alike)
Why would you want to replace all non-ASCII characters by default? Names
of contained objects can be unicode, and URLs can contain unicode
segments as well (encoded as UTF-8). Having the default namechooser make
the arbitrary decision of disallowing everything that's not ASCII seems
quite arbitrary.
* replace spaces by - or _
Again, object names may contain spaces. I don't understand why this
should be the *default* policy. If you need this kind of stuff, then I
suggest you write your own namechooser; it's quite trivial.
--
http://worldcookery.com -- Professional Zope documentation and training
Christian Zagrodnick
2007-10-15 08:01:03 UTC
Permalink
On 2007-10-12 10:21:28 +0200, Philipp von Weitershausen
Post by Philipp von Weitershausen
Post by Christian Zagrodnick
I constantly run into the fact that the default namechooser in Zope 3
is too dumb.
* replace all non us-ascii and otherwise harmful chars by something
useful (base-form or alike)
Why would you want to replace all non-ASCII characters by default?
Names of contained objects can be unicode, and URLs can contain unicode
segments as well (encoded as UTF-8). Having the default namechooser
make the arbitrary decision of disallowing everything that's not ASCII
seems quite arbitrary.
Of course they can. But looking from the browser/user perspective any
URL containing %XY looks just strange. Also those urls are often
garbled by mail programms or alike.
Post by Philipp von Weitershausen
Post by Christian Zagrodnick
* replace spaces by - or _
Again, object names may contain spaces. I don't understand why this
should be the *default* policy. If you need this kind of stuff, then I
suggest you write your own namechooser; it's quite trivial.
Of course it's trival. Only that I've *always* had to replace it with
something else for every single project so far. So from my perspective
the default might work but is sort of useless.

But well, maybe it's not work the effort since we've eggs now.
--
Christian Zagrodnick

gocept gmbh & co. kg ? forsterstrasse 29 ? 06112 halle/saale
www.gocept.com ? fon. +49 345 12298894 ? fax. +49 345 12298891
Loading...