I want to add my field to the table user_user_group. I can add a field to table groups but I can not add a field to the many-to-many group field in the user model. I use a monkey solution for add field to groups model but it does not work for many-to-many group field in the user model.
this code work:
Group.add_to_class('type', models.IntegerField(choices=RoleType.choices, default=RoleType.ADMIN))
this code does not work:
User.groups.through.add_to_class('organization', models.ForeignKey(Organization, on_delete=models.CASCADE, null=True))
are you have any solution?
solve this solution or tell me other solution