Re: Django - using intermediate user group model

2018-09-24 Thread Mateusz
I still doubt if I understood correctly, but if yes -- https://docs.djangoproject.com/en/2.1/topics/db/examples/many_to_many/ contains your answer. Either you don't need 'through' table (because it would not carry any additional data), or if you do... you can just add only foreign keys to

Re: Django - using intermediate user group model

2018-09-24 Thread Fernando Balmaceda
Thanks for the answer Mateusz, but i need the original intermediate between User and Groups. i don't need to create my custom group model El domingo, 23 de septiembre de 2018, 14:19:45 (UTC-3), Mateusz escribió: > > Is that User [N] -- [N] Group with many to many through Enrollment > (something

Re: Django - using intermediate user group model

2018-09-23 Thread Mateusz
Is that User [N] -- [N] Group with many to many through Enrollment (something like that: User [1] -- [N] Enrollment [N] -- [1] Group)? Then, the answer in this gist here . W dniu piątek, 21 września 2018 20:16:05 UTC+2 użytkownik Fernando Balmaceda

Django - using intermediate user group model

2018-09-21 Thread Fernando Balmaceda
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 =