Is using django auth Group the right way to solve this?

169 views Asked by At

A little background: I am building a discussion board app aimed at educators. It's essentially a reddit-style discussion board where responses to a prompt are 'up-voted' or 'down-voted'. The content creators are anonymous to everyone except an admin/teacher user.

So far it works for a single "classroom"; i.e., there can be one or more admins, one or more students, but so far there is only one "classroom". All the students will see the same discussion threads.

My Problem: I want to expand it so that there can be 'unlimited' classrooms and that any teacher who is interested in using the service can create a group and add students (manually, or by way of some token, etc). I also want students to be able to participate in one or more groups.

It seems that refactoring the models slightly to have a foreign key to django.contrib.auth.models.Groupshould make this possible, but I am not sure if this is what Group is designed to do. At first blush Group and the related Permission look a lot more like the Unix groups metaphor. What I am looking for is a way to have a teacher-user to create a group and to have a student-user join this group and view and create group-specific content.

Am I headed in the right direction? Is there a much better way to accomplish what I am trying to do?

1

There are 1 answers

0
GwynBleidD On

You can make an many-to-many relationship between users, groups and classrooms (additional model that will point to these three models, giving group for user in specified classroom)