I have a bugs
model which is mapped to categories
. Categories can own other categories.
class Bug( models.Model ):
categories = models.ManyToManyField('Category')
name = models.CharField( max_length=100 )
slug = models.SlugField(unique=True)
summary = models.TextField()
summary_markdown = models.TextField(editable=False, blank=True)
date_added = models.DateTimeField(auto_now_add=True)
browser = models.ManyToManyField( Browser )
poster = models.ForeignKey(User)
class Category ( models.Model ):
name = models.CharField( max_length=100 )
slug = models.SlugField(unique=True)
parent = models.ForeignKey( 'self', null=True, blank=True, related_name='children' )
class Meta:
ordering = ['name']
verbose_name_plural = 'Categories'
def __unicode__(self):
return self.name
I am already using django-mptt on the front end view to render categories. I'm wondering how I can modify the admin view so that when I go to create a new bug, instead of a dropdown of categories in non-hierarchial order I get a hierarchial order with checkboxes instead of a dropdown.
Something like:
(checkbox) CSS
(checkbox) Display
(checkbox) Inline-block
(checkbox) Block
(checkbox) Float
(checkbox) Height
(checkbox) Min-height