Ok I managed to get filter_vertical working, thanks.
Now how can I populate the filter_vertical panel in admin with the data in the table?
A piece of my model is:
class Position(models.Model):
POSITIONS = (('GK', 'Goalkeeper'), ('DFC', 'Defender Central'), ('SW', 'Sweeper'),
('DFL', 'Defender Left'), ('DFR', 'Defender Right'),
('WBL', 'Wing Back Left'), ('WBR', 'Wing Back Right'),
('DM', 'Defender Midfielder'), ('MR', 'Midfielder Right'), ('ML', 'Midfielder Left'),
('MC', 'Midfielder Center'), ('AMC', 'Attacking Midfielder Center'), ('AML', 'Attacking Midfielder Left'),
('MC', 'Attacking Midfielder Right'), ('ST', 'Striker'))
position_name = models.CharField(max_length=
50, choices=POSITIONS)
def __unicode__(self):
return self.position_name
class Player(models.Model):
........
........
role = models.ManyToManyField(Position)
.........
in admin:
class PlayerAdmin(admin.ModelAdmin):
.......
.......
filter_vertical = ('role')
I want that in PlayerAdmin I have the choices POSITIONS values listed.
What I should have is something like the image at the following link, with the choices POSITIONS listed on the left panel.
image