django - Strange behaviour of slugify function -
This administrator works perfectly from the site. But the codes below are not working properly in some languages (some characters are missing, such as Turkish "ı").
class Foo (models.model): name = models.CharField (max_length = 50, exclusive = true, dB_indicate = true) slug = model. Slufffish (max_language = 100, exclusive = true, db_indicate = tru) def save (self, * args, ** quad): if not self.slug: self. For example, suppose the name is "ışçğö" and after that slug (slug = slugify (self.name)) super (foo, self) .ave (* args, ** kwargs)
"SCOGO" occurs when instead "iscgo" should be.
It is defined by behavior that a slag is considered to be part of the URL. Although the URLs can support non-Latin characters, they are not supported inside the slug.
Slug is a newspaper term, a slug is a small label for something, which includes only letters, numbers, underscores, or hyphens. They are commonly used in URLs.
The results you are receiving are not compatible with the demo behavior:
> ; & Gt; & Gt; Import django.template.defaultfilters from slugify & gt; & Gt; V = u "ışçğö"> gt; & Gt; & Gt; Slugify (v) u'isg '
Where are you getting these results?
Comments
Post a Comment