On 8/22/06, Waylan Limberg <[EMAIL PROTECTED]> wrote:
>
> It occurs to me that it may be related to the inability to sort such
> items in the 'list_display'. For example, in FooBar I also have the
> following property defined:
>
After posting that I remembered that those model methods/properties
are 'row-level' were I want 'table-wide' filtering so I tried a custom
manager. It works great, except I have no idea how to us it with
list_filter, if it's even possable. Anyone have any input on that?

Anyway, here's my manager as it currently stands:

class FooBarManager(models.Manager):
    def by_foo(self, fooname):
        '''
        Returns all FooBars for Bars of a given Foo

        Usage:
        >>> FooBar.objects.by_foo('Blah')
        '''
        return self.get_query_set().filter(bar__foo__name=fooname)

As I expected list_filter = ('by_foo') didn't work and doesn't really
make sense anyway. On the otherhand my initial attempt at list_filter
= ('bar__foo') seems like it should work.

-- 
----
Waylan Limberg
[EMAIL PROTECTED]

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to