﻿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
12024	error with limit_choices_to with complex queries (Q object) and raw_id_fields	anonymous	nobody	"hello

I have a model.py like this :

{{{ 
class secondaryGroup(models.Model):
    id = models.AutoField(primary_key = True)
    idGroup = models.ForeignKey(Group,db_column = 'idGroup',verbose_name = 'Groupe',limit_choices_to = Q(state='valid') | Q(state='modify'))
    idUser = models.ForeignKey(User,db_column = 'idUser',verbose_name = 'Utilisateur',limit_choices_to = Q(state='valid') | Q(state='modify'))
}}}
and in admin.py :
{{{
class SecondaryGroupAdmin(admin.ModelAdmin):
    form = SecondaryGroupAdminForm
    list_display = ('idUser','idGroup')
    raw_id_fields = ('idUser','idGroup',)
}}}

and I obtain this error in Admin edit form :

Caught an exception while rendering: 'Q' object has no attribute 'items'

Thanks in advance.

Bye.
"		closed	contrib.admin	1.1		fixed		Ryan Nowakowski	Accepted	0	0	0	0	0	0
