#12024: error with limit_choices_to with complex queries (Q object) and raw_id_fields ----------------------------------+----------------------------------------- Reporter: anonymous | Owner: nobody Status: new | Milestone: Component: django.contrib.admin | Version: 1.1 Keywords: | Stage: Unreviewed Has_patch: 0 | ----------------------------------+----------------------------------------- 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. -- Ticket URL: <http://code.djangoproject.com/ticket/12024> Django <http://code.djangoproject.com/> The Web framework for perfectionists with deadlines. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-updates?hl=en -~----------~----~----~----~------~----~------~--~---