ok... i'm trying to use exclude in the query set to get this to work. I'm not entirely sure how my logic should go though...
especially since i would be comparing to lists that would result in <> not being usable... since a user and a group won't contain the same set of groups. is it possible to do use a boolean? i realize list.index(x) returns an error, not a -1 as in java... so how would i get about including a forumgroup.index(User.groups) > -1 of course... that only works if there is one group assigned to the user... i would have to check each group... I'm sure this is a simple logic issue... but i can't seem to figure out what i'd need to do On Jan 19, 1:50 pm, garagefan <monkeygar...@gmail.com> wrote: > pretty vague title i know... > > Can I return a query set via foo.object.filter() where in filter i > check a manytomany field in foo against the group field for a user? > > I guess a way to use a group as a permission? > > IE: An article that would normally appear with a ton of other > articles, in a ManyToMany field tied to groups has been set to Group1. > Now a handful of users are in Group1 and that article is only supposed > to be visible to those people, as well as the other non-group assigned > articles in the list. > > I'd like to take care of this in the views in the render for the > template so that only the objects that can be viewed are passed > through. It seems that permissions are set up by django based on the > models themselves, and i haven't seen anything on creating custom > permissions for groups themselves. So any of the permission check > functions would not work. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---