Re: Adding a group, and users to that group

2007-06-07 Thread Russell Keith-Magee
On 6/7/07, Vincent Nijs <[EMAIL PROTECTED]> wrote: > > Thanks for the help Russ: > > That worked. Next problem :) I want to add users to a group. > > g = Group.objects.get(name='section81') > > gives errors. I'm guessing the errors you are getting are telling you that various attributes can't be

Re: Adding a group, and users to that group

2007-06-07 Thread Vincent Nijs
Thanks for the help Russ: That worked. Next problem :) I want to add users to a group. g = Group.objects.get(name='section81') gives errors. If I could get that to work I'd want to add a user to that group: u = User.objects.get(username='doe') This also give errors. Finally: u.groups.add(

Re: Adding a group, and users to that group

2007-06-06 Thread Russell Keith-Magee
On 6/7/07, Vincent Nijs <[EMAIL PROTECTED]> wrote: > > TypeError: create() takes exactly 1 argument (2 given) > > Any ideas? Calling g = Group.objects.create("section81") is the same as calling Group("section81") This yeilds an error because there is no way of knowing which model field the str

Adding a group, and users to that group

2007-06-06 Thread Vincent Nijs
Hi, I am trying to create a group so that I can then add users to that group. I tried the following which is very similar to how you create users. from django.contrib.auth.models import Group g = Group.objects.create('section81') However this give the following error: exceptions.TypeErro