Hi everyone!

I am trying to add a foreign key in a model to the table intermediary 
between User and Group. Something like this:

from django.db import models
from django.contrib.auth.models import User


class Enrollment(models.Model):
    
    user_groups = models.ForeignKey(User.groups.through, on_delete=models.
CASCADE)

But when i try this, django throws an error:

core.Enrollment.user_groups: (fields.E300) Field defines a relation with 
model 'User_groups', which is either not installed, or is abstract.

How can I achieve this?. 
Using Django 2.0

Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/87d6ad5d-403c-482f-824a-880c9656a0bd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to