I am trying to build a page which allows the admin user to toggle membership to a particular group for each user. I aim to do this with AJAX functionality. I am using Django 2.2.
I have implemented an AJAX call which returns all users in the system - this data populates a data table. The next step is to have a checkbox next to each user, indicating their membership to a group.
I am using the code below in my view to retrieve users.
users = list(GeminiUser.objects.filter(is_active=1).values('email'))
I want the users query result to contain a boolean field for each user indicating their membership to a particular group. How can I achieve this?
Appreciate any guidance.