开发者

How can I access django admin's transliterator for slugs when using fixtures?

开发者 https://www.devze.com 2022-12-22 16:53 出处:网络
In the admin, if you enter in a slug two things 开发者_StackOverfloware applied through JS: The string is made slug-friendly

In the admin, if you enter in a slug two things 开发者_StackOverfloware applied through JS:

  1. The string is made slug-friendly
  2. The string is transliterated if the language is not English, so for example Cyrillic Russian text gets converted into Transliterated Russian ( typed out in English )

I'm basically inserting a couple thousand rows and I need to access this. Does django provide a non-js server-side version of this transliterator which I can access to somehow do the insertion?


Looks like I have to port over the usr/lib/pymodules/python2.5/django/contrib/admin/media/js/urlify.js code unless I can figure out a way to programmatically load all articles on the client side and slugify themselves automatically.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号