Perhaps someone with much more Django experience will correct me, but I am
99% sure that this is impossible.

As I understand it, parameters passed to filter() are translated into SQL
statements.  An arbitrary python method that you write for your object can
do any number of things, which might not be translatable into SQL.  So I
don't see how any "filter on the result of any method" feature would work,
other than doing exactly the implementation you describe.

However, your specific use case sounds like it should be possible to avoid
iterating over everything by changing your model.  Is there a reason why
each Permission model can't have a ManyToMany field with the set of users
allowed by that permission model?

On Mon, Jul 5, 2010 at 11:11 PM, Wiiboy <[email protected]> wrote:

> Anyone?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<django-users%[email protected]>
> .
> 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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to