Unicode support
See original GitHub issueI am working on an Arabic blog and whenever I insert the tags in Arabic it saves the tag’s slug as an empty string. is there a way to allow Unicode tags slugs?
Models
class Post(models.Model, HitCountMixin):
title = models.CharField(max_length=255)
slug = models.SlugField(unique=True, allow_unicode=True)
summary = models.CharField(max_length=500)
header_image = models.ImageField(null=True, blank=True, upload_to="images/")
tags = TaggableManager()
author = models.ForeignKey(User, on_delete=models.CASCADE)
body = RichTextField(blank=True, null=True)
post_date = models.DateField(auto_now_add=True)
update_date = models.DateField(auto_now=True)
category = models.ForeignKey(Category, related_name='posts', on_delete=models.CASCADE)
featured = models.BooleanField(default=False)
views = GenericRelation(HitCount, object_id_field='object_pk',related_query_name='hit_count_generic_relation')
Forms
class AddPostForm(forms.ModelForm):
class Meta:
model = Post
fields = ('title','summary', 'body', 'header_image', 'category', 'tags')
labels = {
"title": "العنوان",
"tags": "العلامات",
"category": "التصنيف",
"summary":"الملخص",
"body": "المحتوى",
"header_image": "الغلاف",
}
widgets = {
'title': forms.TextInput(attrs={'class':'form-control'}),
'tags': forms.TextInput(attrs={'class':'form-control', 'data-role':"tagsinput", 'name':"tags"}),
'category': forms.Select(choices=choices_list, attrs={'class':'form-control'}),
'summary': forms.TextInput(attrs={'class':'form-control'}),
'header_image': forms.FileInput(attrs={'class':'form-control'}),
'body': forms.Textarea(attrs={'class':'form-control'}),
}
Views
class AddPostView(CreateView):
model = Post
form_class = AddPostForm
template_name = 'add_post.html'
def form_valid(self, form):
form.instance.author = self.request.user
return super().form_valid(form)
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Unicode - Wikipedia
This article contains uncommon Unicode characters. Without proper rendering support, you may see question marks, boxes, or other symbols. Unicode's success at ...
Read more >What is Unicode?
Support of Unicode forms the foundation for the representation of languages and symbols in all major operating systems, search engines, browsers ...
Read more >Unicode Support - IBM
Unicode Support. The Unicode Standard is a standardized character code designed to encode international texts for display and storage. It uses a unique...
Read more >Support for Unicode | Microsoft Learn
Unicode is a specification for supporting all character sets, including ones that can't be represented in a single byte.
Read more >Unicode Support - AutoIt
AutoIt Notation, Notepad, Notepad++, SciTE (AutoIt Default Editor). UTF8 without BOM, ANSI or UTF-8 depending on content (will force a BOM if saved) ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@sergeyklay I am really sorry but I found out that I didn’t mention that my issue was with the slugs! the tag is saved but the slug associated with that tag is saved as an empty string.
sorry again for the confusion
This should be fixed in django-taggit 3.0.0!