Re: Custom admin changelist queryset

2011-11-18 Thread Ivo Brodien
Both Bar and Foo obviously have a featured table and are somehow very common since you want them to be displayed in on list - which also makes only sense if they share the same attributes cause otherwise you would have empty columns depending on the model of the row your are showing. Maybe Bar

Re: Custom admin changelist queryset

2011-11-18 Thread bax...@gretschpages.com
> Can you tell us what you goal here is? The goal is to get my combined list of featured items to a changelist page. From there, I'll have additional work to do, but step one is getting it to the page at all. Another thought is to just chain the querysets together and send 'em to my own template.

Re: Custom admin changelist queryset

2011-11-17 Thread Ivo Brodien
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

Custom admin changelist queryset

2011-11-17 Thread bax...@gretschpages.com
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 ... re