﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
1891	ForeignKey with m2m filter can duplicate foreign model entries in ModelForm/ModelChoiceField	mattimustang@…	Crowley Shaita	"My app has the following models similar to:

{{{
#!python

PROXY_GROUPS = ('Terminal Server', 'Socks Proxy', 'Web Proxy')

class Group(models.Model):
    name = models.CharField(maxlength=32)

class Asset(models.Model):
    name = models.CharField(maxlength=32)
    groups = models.ManyToManyField(Group)

class Proxy(models.Model):
    asset = models.ForeignKey(Asset, limit_choices_to={'groups__name__in': PROXY_GROUPS, 'distinct':True})
    port = models.PositiveIntegerField()
}}}

Which spews an error when I try to add a Proxy object in the admin. The error is something to do with 'distinct' not being a valid field (Sorry i can post the exact error later).

How can I achieve the equivalent to this in the current post-mr trunk?

From #django earlier today:
{{{
malcolmt	mattimustang_: I think you've found a bug. You're right, distinct has become a method on QuerySets, not a filter parameter now. So you may be temporarily stuck. Can you file a ticket so we don't forget to fix this somehow, please?
}}}

"	Bug	closed	Database layer (models, ORM)		Normal	fixed		mattimustang@… gary.wilson@… Aurelio Tinio charette.s@… someuniquename@…	Ready for checkin	1	0	0	0	0	0
