On 7/3/07, jj <[EMAIL PROTECTED]> wrote:
>     def is_visible_by(self, author):
>         projects = author.projects.all()
>         return author.user.is_staff or\
>             author.is_manager  or\
>             (author.is_lead_writer and (self.project in projects)) or\
>             (author == self.main_author or author in
> self.co_authors.all())
>
> Can this be turned into an SQL query using filter() or extra()?

Depends which DB you're using, really?

But that's going to kill performance if you're working on many books at a time.

You're doing a 2 separate queries for each book.

--~--~---------~--~----~------------~-------~--~----~
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