def facility_query(self, user):
    queryset = Facility.objects.all()
    if user.is_superuser:
        pass
    elif (user.user_type >= User.TYPE_VALUE_MAP['StateLabAdmin']):
        queryset = queryset.filter(state=user.state)
    elif (user.user_type >= User.TYPE_VALUE_MAP['DistrictLabAdmin']):
        queryset = queryset.filter(district=user.district)
    elif (user.user_type >= User.TYPE_VALUE_MAP['BlockAdmin']):
        queryset = queryset.filter(block=user.block)
    elif (user.user_type >= User.TYPE_VALUE_MAP['LocalBodyAdmin']):
        queryset = queryset.filter(local_body=user.local_body)
    else:
        queryset = queryset.filter(users__id__exact=user.id)
    return queryset
def facility_query(self, user):
    queryset = Facility.objects.all()
    if user.is_superuser:
        pass
    elif (user.user_type >= User.TYPE_VALUE_MAP['StateLabAdmin']):
        queryset = queryset.filter(state=user.state)
    elif (user.user_type >= User.TYPE_VALUE_MAP['DistrictLabAdmin']):
        queryset = queryset.filter(district=user.district)
    elif (user.user_type >= User.TYPE_VALUE_MAP['BlockAdmin']):
        queryset = queryset.filter(block=user.block)
    elif (user.user_type >= User.TYPE_VALUE_MAP['LocalBodyAdmin']):
        queryset = queryset.filter(local_body=user.local_body)
    else:
        queryset = queryset.filter(users__id__exact=user.id)
    return queryset