I've used Django.treebeard to create a hierarchical system to classify books like so:
The 'genres' model is related to another model by a many-to-many relationship, and I need to be able to select the right genres (ie, Fiction>Adult>Science Fiction>Hard Science Fiction) in the admin page for the other model. Checkboxes seem to be the best way to do this, but when I use them in they look like this:
So I can't see the different levels of the hierarchy. The best I've been able to come up with is adding the following to the Models:
def __str__(self):
return '%s%s' % ('--' * self.depth, self.name)
Which results in this, which is not much better:
What I need is for the checkboxes themselves to move, not just the text, and to have functionality like being able to 'open' and 'shut' the parent categories, select/deselect all children by selecting the parent etc. Is there any way to do this?