Django 管理员:列表不正确(重复行)

Django admin: list not correct (duplicate rows)

我的admin.py是这样的:

class ResizableAdmin(admin.ModelAdmin):
    class Media:
        css = {
        }
        js = ('js/vendor/jquery-1.11.2.min.js',)

class GroupeMotsForm(django.forms.ModelForm):
    mots = django.forms.ModelMultipleChoiceField(
        queryset=Mot.objects.all().order_by('groupes__description', 'texte'),
        widget=django.forms.SelectMultiple(attrs={'class': 'resize_dst'})
    )

    class Meta:
        model = GroupeMots
        fields = ['description', 'admin_taille_fenetre', 'mots', ]
        widgets = {
            'admin_taille_fenetre': django.forms.NumberInput(
                attrs={'class': 'resize_src'}
            )
        }


class GroupeMotsAdmin(ResizableAdmin):
    form = GroupeMotsForm

在我的数据库中,我在 GroupeMots 中只有一行:

在管理界面列表中显示3次:

知道去哪里找吗? Django 在哪里可以看到 3 个结果?它们都指向同一条记录。我卡住了。

我的模型是这样的:

class GroupeMots(models.Model):
    description = models.CharField(max_length=150)
    mots = models.ManyToManyField(Mot, blank=True)

    class Meta:
        ordering = ['mots__texte']

    def __str__(self):
        return u'{0}'.format(
            self.description
        )

问题出在ordering = ['mots__texte'],因为好像有3个结果,所以"ordering"生成了dupes...我把它改成了description,现在可以了