I would like to find a way to get categories and subcategories displayed in the admin, in the form of a multiple select.
Like:
parent
----child1
----child2
parent2
----child3
Do I have to make a custom field or is there already a solution around?
Edit
the model is:
class Category(models.Model):
def __unicode__(self):
return self.name_en
name = models.CharField(_('name'), max_length=255, null=True)
slug = models.SlugField(_('slug'), db_index=True, unique=True)
parent = models.ForeignKey('self', blank=True, null=True, related_name='child')
description = models.TextField(_('description'), null=True)
You don't need a custom field, just a custom widget. Here is an example widget i cooked up. it's untested, so treat it like pseudo-code :)