﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
33923	Swappable Model support for Group Model	Vasanth	nobody	"When dealing with custom groups there are two ways of extending the model

1. Create a separate ""GroupExtension"" model  and define an OneToOne relationship to the Group model
2. Inherit the default Group Model into a new CustomGroup model

Since my current project uses object-level permission (django-guardian)  everywhere and quite a few additional fields I decided to go along with option 2. However, I quickly found that the Group model is not swappable in the same manner as the user model.

Trying to implement it manually has further let me down the rabbit hole where I found that libraries have hardcoded dependency onto the Group model directly. This makes working with custom group models quite hard.

It'd be great if the the group model can also be defined in the settings which can then be leveraged by all libraries to provide a smoother dev experience working with Custom Group and permissions


For reference my current user and group looks something like, 


{{{
class CustomGroup(Group):
    additional_field = models.CharField(max_length=10)
    ....

class CustomUser(AbstractBaseUser, PermissionsMixin):
    groups = models.ManyToManyField(CustomGroup)
    ....
}}}
"	New feature	closed	contrib.auth	4.1	Normal	duplicate			Unreviewed	0	0	0	0	0	0
