Hello Django Nerds! So I have a (somewhat) complicated lookup I'm trying to do; here's the gist of it:
1. I have a Store class, with a User ManyToManyField, Store.users 2. I have a user profile class associated with each user, UserProfile, accessible through the usual User.get_profile() 3. UserProfile has a status variable, UserProfile.status, which can be 'Active', 'Inactive', or 'Deleted' I'm trying to display a list of users for a particular store; currently I generate this list using the following line: userList = request.session['currentStore'].users.all() Works great; however, now I'd like to filter out all users with a status of 'Deleted'. Now, if status were a User attribute, I could just try this: userList = request.session['currentStore'].users.exclude(status=='Deleted') or something similar. THE PROBLEM: How do I generate this no-deleted-users list for the given store, using the ManyToManyField Store.users, but based on the store.users UserProfile.status? I know there's some kinky django black magic reverse-lookup way to do it in a single magnificent line...just haven't a clue what it might be. Ideas? First person with the right answer: thank you - please treat yourself to a donut... -- 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.