#5368: allow .(dot) in slug fields
--------------------------------------------------+-------------------------
Reporter: Amit Upadhyay <[EMAIL PROTECTED]> | Owner: amitu
Status: assigned | Component:
Uncategorized
Version: SVN | Resolution:
Keywords: | Stage:
Design decision needed
Has_patch: 1 | Needs_docs: 0
Needs_tests: 0 | Needs_better_patch: 0
--------------------------------------------------+-------------------------
Comment (by anonymous):
Replying to [comment:5 Yuri Baburov <[EMAIL PROTECTED]>]:
> > Just wondering, why is dot not allowed in slug? Its a very mainstream
character in URLs.
> And why they should be allowed? :)
Taking your example of tags, slug is the proper choice for the text of the
tag, but people want to use .(dot) in their tag names, to not allow it on
legacy/backward compatibility is just a technology quirk we are allowing
to dictate a decision. Sure technological considerations are important and
there is a work around, monkey patch or use your own SlugField derived
class, but for the simple use case of using slug as tag, the fact that
.(dot) was not allowed would be seen as a historic mistake and not as a
decision taken on strong technical grounds.
But why stop at .(dot), how about the other characters? The basic idea
behind slug comes from beautiful URLs, and "~ ` [EMAIL
PROTECTED]&*()-_=+:;'",.?" gets
translated to
"%7E+%60+%21%40%23%24%25%5E%26*%28%29-_%3D%2B%3A%3B%27%22%2C.%3F" in URL,
and we can see that only *(asterisk), -(hyphen), _(underscore) and .(dot)
do not get mangled. We do not allow _(underline) because links are usually
underlined, and its difficult to see the underline in links. This leaves
us with precisely two characters: dot and hyphen (1), one is already
allowed(hyphen) and I feel we should allow the other one too.
1: *(asterisk) is a mathematical symbol that people do not usually use so
it may be left out, but with this line of reasoning it may be okay to
allow it too.
--
Ticket URL: <http://code.djangoproject.com/ticket/5368#comment:7>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---