我正在尝试过滤管理页面的下拉选择中显示的条目。
class GroupDepartmentMembership(models.Model):
department = models.ForeignKey('department.Department', related_name="group_memberships")
group = models.ForeignKey('group.Group', related_name="department_memberships", limit_choices_to={'pk__in': [m.group.pk for m in department.group_memberships.filter(lead__exact=True)]})
lead = models.BooleanField(default=True)
但是随后我在控制台中收到以下异常,没有任何其他堆栈跟踪。
< main .NewThreadStartup instance at 0x28ff680>启动的线程中未处理的异常
你能帮我找出错误吗?谢谢!