get only the data of the current user
        :param queryset:
        :return:
553901
def get_object(self, queryset=None):
        
        obj = User.objects.get(id=self.request.user.id)
        return obj
487038
def get_queryset(self):
        
        forums = self.request.forum_permission_handler.get_readable_forums(
            Forum.objects.all(), self.request.user,
        )
        topics = Topic.objects.filter(forum__in=forums)
        topics_pk = map(lambda t: t.pk, track_handler.get_unread_topics(topics, self.request.user))
        return Topic.approved_objects.filter(pk__in=topics_pk).order_by('-last_post_on')
910824
def get_queryset(self, request):
        """"""
        qs = super(TenantAdmin, self).get_queryset(request)
        if not request.user.is_superuser:
            tenants_by_group_manager_role = qs.filter(
                group__tenantrole__user=request.user,
                group__tenantrole__role=TenantRole.ROLE_GROUP_MANAGER
            )
            tenants_by_tenant_manager_role = qs.filter(
                tenantrole__user=request.user,
                tenantrole__role=TenantRole.ROLE_TENANT_MANAGER
            )
            return tenants_by_group_manager_role | tenants_by_tenant_manager_role
        return qs
1046801
def users_view_user(self, ):
        
        i = self.users_tablev.currentIndex()
        item = i.internalPointer()
        if item:
            user = item.internal_data()
            self.view_user(user)
2185
def get_object(self, queryset=None):
        
        profile, dummy = ForumProfile.objects.get_or_create(user=self.request.user)
        return profile
948711
def get(self, *args, **kwargs) -> "QuerySet":
        
        queryset = self.filter(*args, **kwargs)
        queryset._limit = 2
        queryset._get = True
        return queryset
482373
def current_user(self):
        
        if not hasattr(self, '_serverInfo') or 'username' not in self._serverInfo:

            url = self._get_url('serverInfo')
            r = self._session.get(url, headers=self._options['headers'])

            r_json = json_loads(r)
            if 'x-ausername' in r.headers:
                r_json['username'] = r.headers['x-ausername']
            else:
                r_json['username'] = None
            self._serverInfo = r_json
            # del r_json['self']  # this isn't really an addressable resource
        return self._serverInfo['username']
642484
def get_object(self, queryset=None):
        
        if queryset is None:
            queryset = self.get_queryset()

        try:
            return queryset.get(user__pk=self.request.user.pk)
        except ObjectDoesNotExist:
            raise Http404
1269533
def _get_user(self) -> Dict:
        

        if 'callback_query' in self._update:
            return self._update['callback_query']['from']
        elif 'inline_query' in self._update:
            return self._update['inline_query']['from']
        elif 'message' in self._update:
            return self._update['message']['from']
1058574
def get_user(self, user_id):
        
        user_model = get_user_model()
        try:
            return user_model.objects.get(id=user_id)
        except user_model.DoesNotExist:
            return None
361278
def by_current_session(cls):
        
        session = Session.current_session()
        if session is None:
            return None
        return cls.where_id(session.user_id)
24637
def get_user_info(self):
        
        response = self._session.get(BASE_URL_TSQUARE + '/user/current.json')
        response.raise_for_status() # raises an exception if not 200: OK
        user_data = response.json()
        del user_data['password'] # tsquare doesn't store passwords
        return TSquareUser(**user_data)
1298225
def get_current_user(self, objectmask=None):
        """"""

        if objectmask is None:
            objectmask = "mask[userStatus[name], parent[id, username]]"
        return self.account_service.getCurrentUser(mask=objectmask)
82884
def find_by_user(user: str) -> List['ApiKey']:
        
        return [ApiKey.from_db(key) for key in db.get_keys(qb.from_dict({'user': user}))]
1268871
def accessible_to(self, user):
        
        if user.is_superuser:
            try:
                queryset = self.get_queryset()
            except AttributeError:
                queryset = self
        elif user.is_authenticated():
            # get user group (higher id)
            group = user.groups.all().order_by('-id')[0]
            queryset = self.filter(access_level__lte=ACCESS_LEVELS.get(group.name))
        else:
            queryset = self.filter(access_level__lte=ACCESS_LEVELS.get('public'))
        return queryset
1125470
def get_queryset(self):
        
        qs = VersionedQuerySet(self.model, using=self._db)
        if hasattr(self, 'instance') and hasattr(self.instance, '_querytime'):
            qs.querytime = self.instance._querytime
        return qs
539640
def current_user():
    
    user_id = current_user_id()
    guard = current_guard()
    user = guard.user_class.identify(user_id)
    PraetorianError.require_condition(
        user is not None,
        "Could not identify the current user from the current id",
    )
    return user