Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
Try like this:
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
class Category(models.Model):
name = models.CharField(max_length=32, verbose_name='Наименование')
class Meta:
verbose_name = 'Категорию'
verbose_name_plural = 'Категории'
def __unicode__(self):
return unicode(self.name)
def __str__(self):
return self.__unicode__()
Look aside https://docs.djangoproject.com/ja/1.9/ref/utils/#m... or switch to python3 (unicode is a good reason).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question