コード例 #1
0
    def active(self, timeout=None):
        if not timeout:
            timeout = utils.get_timeout()

        now = datetime.now()
        cutoff = now - timedelta(minutes=timeout)

        return self.get_query_set().filter(last_update__gte=cutoff)
コード例 #2
0
ファイル: models.py プロジェクト: kalaiR/evewat
    def active(self, timeout=None):
        """
        Retrieves only visitors who have been active within the timeout
        period.
        """
        if not timeout:
            timeout = utils.get_timeout()

        now = datetime.now()
        cutoff = now - timedelta(minutes=timeout)

        return self.get_query_set().filter(last_update__gte=cutoff)
コード例 #3
0
    def active(self, timeout=None):
        """
        Retrieves only visitors who have been active within the timeout
        period.
        """
        if not timeout:
            timeout = utils.get_timeout()

        now = datetime.now()
        cutoff = now - timedelta(minutes=timeout)

        return self.get_query_set().filter(last_update__gte=cutoff)
コード例 #4
0
ファイル: models.py プロジェクト: mrfunyon/django-tracking
 def online(self):
   if self.last_update:
     timeout = utils.get_timeout()
     cutoff = datetime.now() - timedelta(minutes = timeout)
     return cutoff < self.last_update
   return False