» Django slug field in Arabic and other foreign languages
Django slug field in Arabic and other foreign languages
|May 19, 2013
Posted by forumadmin
am trying to build an app with a model which contains a unique of the title, some users will write the title in Arabic and other languages and when on save, I try to slugify the field. It would return blank in case of Arabic. Any way to show arabic wordings but maintain slug principles of replacing special characters and spaces with dash?
title = models.CharField(max_length=100)
slug = models.SlugField()
def save(self, *args, **kwargs):
if self.slug is in (None, '', u''):
self.slug = slugify(self.title)
super(Article, self).save(*args, **kwargs)
More Related Questions
- How to support Arabic text in Android? I am getting Arabic text from server successfully. Retrieved text I want display in code but its showing boxes instead of Arabic text. Assume that t array values are Arabic text from […]
- Android print arabic words i want to build client/server application, the client is android (2.2) application, and the server is tomcat Java server ,IDE is Eclips
i want to send arabic data from server to client […]
- I want to read my *.bok and *.mdb in Ubuntu 12.04? When I use Windows I read my arabic book (*.mdb & *.bok) by maktaba shamela.
And now I use ubuntu 12.04 and I need to read my *.bok & .mdb file. I tried to install makatba […]
- CharInSet doesnt work with non English letters? I have updated an application from Delphi 2007 to Delphi 2010, everything went fine, except one statement that compiled fine but not working which is:
If Edit1.Text in ['S','س'] then
- Printing Arabic text in command prompt in Java I have a Java program which prints Arabic text to Command prompt in windows. I read the text in three ways,
From hard coded Arabic String
When I run the code […]
- Weird issue with Droid Arabic on Google Chrome for Windows I wanted to use Android fonts "Droid Arabic Kufi" and "Droid Arabic Naskh" on my website but now I have a weird issue... There are line-breaks between words!
Could this be an […]
- why are arabic numbers (١٢٣) not accepted in textboxes as real numbers? while developing one of my sites, i noticed that if I enter arabic numbers (١٢٣), they are not interpreted as real number values. Then, I tested a few other sites only to […]
- Getting `document.location.href` with Arabic letters The problem is that i don't get the document.location.href in Arabic letters.
i get it as
- Django queryset specific order by based on values of foreign key I have two models, Position and Player, for a baseball site. Positions are named pitcher, catcher, first base, second base, third base, etc.
name = […]
- Django Piston: How can I exclude nested fields from handler results? Is it even possible? Before the question, the background:
I am putting the finishing touches on an API I have written for a Django app utilizing django-piston. The API is able to search by request or IP […]