I am trying to create a Customuser model and getting this error and i dont know where to add or change the related_name argument.
class CustomUser(AbstractUser):
age = models.PositiveIntegerField(null=True, blank=True)
user_type = models.ForeignKey(
UserType, verbose_name='User Type', on_delete=models.SET_NULL, null=True)
level_master = models.ForeignKey(
LevelMaster, on_delete=models.SET_NULL, null=True, blank=True)
upload_image = models.ImageField(upload_to='media', null=True)
# level_name = models.ManyToManyField(LevelMaster
# verbose_name="Level Name", max_length=150, unique=True, null=True, blank=True)
l1=models.BigIntegerField(null=True,blank=True)
l2 = models.BigIntegerField(null=True, blank=True)
l3 = models.BigIntegerField(null=True, blank=True)
created_at = models.DateTimeField(
verbose_name='Created At', auto_now_add=True, null=True, blank=False)
updated_at = models.DateTimeField(
verbose_name='Updated At', auto_now=True, null=True, blank=False)
class Meta:
db_table = 'tbl_customeruser'
managed = False
def __str__(self) -> str:
return self.username
2023-11-03 10:57:47 ERRORS:
2023-11-03 10:57:47 auth.User.groups: (fields.E304) Reverse accessor 'Group.user_set' for 'auth.User.groups' clashes with reverse accessor for 'inspectionactivity.CustomUser.groups'.
2023-11-03 10:57:47 HINT: Add or change a related_name argument to the definition for 'auth.User.groups' or 'inspectionactivity.CustomUser.groups'.
2023-11-03 10:57:47 auth.User.user_permissions: (fields.E304) Reverse accessor 'Permission.user_set' for 'auth.User.user_permissions' clashes with reverse accessor for 'inspectionactivity.CustomUser.user_permissions'.
2023-11-03 10:57:47 HINT: Add or change a related_name argument to the definition for 'auth.User.user_permissions' or 'inspectionactivity.CustomUser.user_permissions'.
2023-11-03 10:57:47 inspectionactivity.CustomUser.groups: (fields.E304) Reverse accessor 'Group.user_set' for 'inspectionactivity.CustomUser.groups' clashes with reverse accessor for 'auth.User.groups'.
2023-11-03 10:57:47 HINT: Add or change a related_name argument to the definition for 'inspectionactivity.CustomUser.groups' or 'auth.User.groups'.
2023-11-03 10:57:47 inspectionactivity.CustomUser.user_permissions: (fields.E304) Reverse accessor 'Permission.user_set' for 'inspectionactivity.CustomUser.user_permissions' clashes with reverse accessor for 'auth.User.user_permissions'.
2023-11-03 10:57: