mirror of
https://github.com/jazzband/django-categories.git
synced 2026-05-13 01:53:12 +00:00
Switched form using force_unicode to force_text
This commit is contained in:
parent
c5c459fe42
commit
87a22098be
2 changed files with 4 additions and 4 deletions
|
|
@ -6,7 +6,7 @@ with customizable metadata and its own name space.
|
|||
from django.contrib import admin
|
||||
from django.db import models
|
||||
from django import forms
|
||||
from django.utils.encoding import force_unicode
|
||||
from django.utils.encoding import force_text
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from mptt.models import MPTTModel
|
||||
|
|
@ -65,7 +65,7 @@ class CategoryBase(MPTTModel):
|
|||
|
||||
def __unicode__(self):
|
||||
ancestors = self.get_ancestors()
|
||||
return ' > '.join([force_unicode(i.name) for i in ancestors] + [self.name, ])
|
||||
return ' > '.join([force_text(i.name) for i in ancestors] + [self.name, ])
|
||||
|
||||
class Meta:
|
||||
abstract = True
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from django.core.urlresolvers import reverse
|
||||
from django.db import models
|
||||
from django.utils.encoding import force_unicode
|
||||
from django.utils.encoding import force_text
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from functools import reduce
|
||||
try:
|
||||
|
|
@ -64,7 +64,7 @@ class Category(CategoryBase):
|
|||
except NoReverseMatch:
|
||||
prefix = '/'
|
||||
ancestors = list(self.get_ancestors()) + [self, ]
|
||||
return prefix + '/'.join([force_unicode(i.slug) for i in ancestors]) + '/'
|
||||
return prefix + '/'.join([force_text(i.slug) for i in ancestors]) + '/'
|
||||
|
||||
if RELATION_MODELS:
|
||||
def get_related_content_type(self, content_type):
|
||||
|
|
|
|||
Loading…
Reference in a new issue