Well the admin.ModelAdmin expects to be working, for one model only (knowing about its table structure).
Can you tell us what you goal here is? Probably you want to show more information than there is in one model? You can create methods in your model and use them to show more information like this in a "BarAdmin": class BarAdmin(admin.ModelAdmin): list_display = ['more_info'] def more_info(self,obj): return self.foo.name more_info.allow_tags = True # to show HTML tags more_info.short_description = ‘More Info’ #a nicer name admin.site.register(Bar,BarAdmin) How did you register your FeaturedItemsModelAdmin? Bye Ivo On Nov 17, 2011, at 21:11 , bax...@gretschpages.com wrote: > I'm trying to combine a subset of two models and pass them to an admin > change list: > > class FeaturedItemsAdmin(admin.ModelAdmin): > def queryset(self, request): > qs1 = Foo.objects.filter(featured=True) > qs2 = Bar.objects.filter(featured=True) > ..... do stuff to combine ... > return combined > > > I can return qs1 or qs2 to the admin, no problem. But I can't put them > together in a way the admin will accept. > > First thing I tried was a simple itertools.chain. I've also tried > building a custom queryset (http://djangosnippets.org/snippets/1933/) > and subclassing queryset. At best, I get nothing, but most times I > get: > > "Database error > Something's wrong with your database installation. Make sure the > appropriate database tables have been created, and make sure the > database is readable by the appropriate user." > > Which I've tracked down to a IncorrectLookupParameters exception in > contrib.admin.options, but that doesn't really help me figure out what > it is the admin wants that I'm not giving it. > > > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.