开发者

Django mptt admin category

开发者 https://www.devze.com 2023-03-23 04:16 出处:网络
I am using the basic configuration for Django Mptt Admin from django.contrib import admin from mptt.admin import MPTTModelAdmin

I am using the basic configuration for Django Mptt Admin

from django.contrib import admin
from mptt.admin import MPTTModelAdmin
from teklifpark.categories.models import Category

admin.site.register(Category, MPTTModelAdmin)

But in the admin panel I cannot view c开发者_开发百科ategory names. I can create but while choosing the parent category in the drop down box I can only view Category Object instead of name of the category how can I fix it.


I'm sure that you didn't added

def __unicode__(self):
    return u'%s' % self.title

in your Category class


I saw on the #django channel a similar question to yours take a look here http://django-irc-logs.com/2011/jul/13/#52263

hope that helps

0

精彩评论

暂无评论...
验证码 换一张
取 消