I need to insert the group_id of a user(user in auth_user table) to auth_user_groups table. How can we achieve this?
To insert into auth_user table we can do
details = User(username = "somename",password = "somepassword", email = "email",
first_name = "firstname",
last_name = "lastname",
is_staff = 0,
is_active = 1,
is_superuser = 0
)
details.save()
Is there any method like
save = auth_user_groups(user_id=1,group_id = 5)
this??
1 Answer