I have few querysets that I use in every single view (>50). Is there a way to write once for all and keep the queryset result available for all views ?
def MyView(request):
company= Company.objects.get(User=request.user)
user_info= User_infos.objects.get(User= request.user)
groups= request.user.groups.values_list('name',flat = True)
I'm using those results for filtering purposes like
Product.objects.filter(Company = company)
question from:https://stackoverflow.com/questions/65936486/optimize-repeteted-queryset