I think the fastest solution to your problem would be to simply call CustomUser.objects.get(user=user) (this assumes the user is an attribute in your CustomUser model. I would do the following:
class CustomUser(models.Model): user = models.ForeignKey(User, unique=True)
Therefore, when you receive a request to select CustomUsers, you can filter out the one you want based on using your user's filter on request.
Otherwise, you can change the middleware to include CustomUsers instead of users, but I donβt know exactly how to do this;)
EDIT: Mark mentioned to me that he would prefer to use inheritance, so he could use all user methods of the user, which makes sense, and so I found an article to fix this problem.
Here it is.
shawnjan
source share