@ -32,6 +32,8 @@ class CategoryAdmin(admin.ModelAdmin):
get_str.admin_order_field = 'title'
list_display = ('title', get_str,)
list_filter = ('parent', )
prepopulated_fields = {"slug": ("title",)}
inlines = [AttributeForCategoryInline, ]
@ -22,7 +22,8 @@ class Category(models.Model):
description = models.TextField(
'Описание', default='', null=True, blank=True)
parent = models.ForeignKey(
'self', default=None, null=True, blank=True, related_name='childs')
'self', default=None, null=True, blank=True, related_name='childs',
verbose_name='Родительская категория')
attributes = models.ManyToManyField(
'Attribute', through='AttributeForCategory')