mirror of
https://github.com/jazzband/django-categories.git
synced 2026-05-14 18:43:13 +00:00
Changed __unicode__ to __str__ on the CategoryBase class for Python 3 compatibility
This commit is contained in:
parent
32144dd779
commit
600aaef926
1 changed files with 3 additions and 2 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_text
|
||||
from django.utils.encoding import force_text, python_2_unicode_compatible
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from mptt.models import MPTTModel
|
||||
|
|
@ -29,6 +29,7 @@ class CategoryManager(models.Manager):
|
|||
return self.get_queryset().filter(active=True)
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class CategoryBase(MPTTModel):
|
||||
"""
|
||||
This base model includes the absolute bare bones fields and methods. One
|
||||
|
|
@ -63,7 +64,7 @@ class CategoryBase(MPTTModel):
|
|||
item.active = self.active
|
||||
item.save()
|
||||
|
||||
def __unicode__(self):
|
||||
def __str__(self):
|
||||
ancestors = self.get_ancestors()
|
||||
return ' > '.join([force_text(i.name) for i in ancestors] + [self.name, ])
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue