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.

Reply via email to