Looking for some help, if possible
Working Django with 1.11.x and Django smart_selects 1.5.x
from smart_selects.db_fields import ChainedManyToManyField
class Project(Model):
"""Project is a holder for a group of activities carried out as sub-projects.
"""
id = AutoField(primary_key=True)
name = CharField(unique=True)
description = CharField()
class Milestone(Model):
"""Milestone is a time-based goal for a Project.
"""
id = AutoField(primary_key=True)
project = ForeignKey(Project)
description = TextField()
planned_year = PositiveIntegerField()
planned_quarter()
class SubProject(Model):
"""SubProject is an activity carried out as part of a single Project.
"""
id = AutoField(primary_key=True)
project = ForeignKey(Project)
code = CharField(unique=True)
milestones = ChainedManyToManyField(
Milestone,
blank=True,
horizontal=True,
chained_field="project",
chained_model_field="milestones")
However, the admin form for SubProject simply shows the usual admin multi-select box (i.e. just a long list of unfiltered milestones).
What needs to change in the above code to create a working smart_selects version?
Thanks
Derek