django - Not able to expose 'auth_user_groups' table in Tastypie UserResource -


I am struggling to know that my UserResource Tastypie modelResource is a way to unselect the 'auth_user_groups' table.

I am able to receive groups and users, but it is not certain how the user is assigned within my user resources. Here are model resons I: GroupResource (ModelResource): Class Meta: queryset = Group.objects.all () always_return_data = True resource_name = 'groups' detail_allowed_methods = ['get'] List_allowed_methods = {'Get'] filtering = {'username': ALL,} authentication = ApiKeyAuthentication () class UserResource (ModelResource): class meta: queryset = User.objects.all () always_return_data = true resource_name = 'user' excludes = ['Active', 'is_staff', 'is_superuser'] authorization = user authorization () detail_allowed_methods = ['go', 'post', 'put', 'delete', 'patch'] list_allowed_methods = ['get', ' Post filtering = {'username': ALL,} authentication = ApiKeyAuthentication ()

Thank you for your help. / div>

As stated:

ModelResource subclass

So you have to add group fi to your UserResource :

 < Code> Category in UserResource: Group = fields.ManyToManyField (GroupResource, 'groups', null = true, full = true) Class Meta: [...]    < / Html>

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -