1 2 3 4 5 6 | from django.contrib.auth.models import Group, User
new_user = User(username="foo", password="bar")
example_group = Group.objects.get(name="<GROUP_NAME>")
example_group.user_set.add(new_user)
|
More like this
- create or update, then get, model instances from JSON/py dict by anentropic 1 year, 6 months ago
- is_dirty and dict of changed values by jaredthane 3 years, 10 months ago
- group_required decorator by msanders 3 years, 9 months ago
- More information about users and groups in user admin by ramusus 3 years, 10 months ago
- Technical 500 by group membership by jdunck 3 years, 9 months ago
Comments