stashboard/models.py
def history(self, days, default, start=None):
        """ Return the past n days of activity AFTER the start date.

        Arguments:
        days    -- The number of days of activity to calculate
        default -- The status to use as the base status

        Keyword Arguments
        start   -- The day to look before (defaults to today)

        This funciton is currently only used on the front page
        """
        start = start or date.today()
        ago = start - timedelta(days=days)

        events = self.events.filter('start >=', ago) \
            .filter('start <', start).fetch(100)

        stats = {}

        for i in range(days):
            start = start - timedelta(days=1)
            stats[start.day] = {
                "image": default.image,
                "name": default.name,
                "day": start,
                "information": False,
            }

        for event in events:
            if event.status.slug != default.slug:
                stats[event.start.day]["image"] = "icons/fugue/information.png"
                stats[event.start.day]["information"] = True
                stats[event.start.day]["name"] = "information"

        history = stats.values()
        history.sort()
        history.reverse()

        return history
 Return the past n days of activity AFTER the start date.

        Arguments:
        days    -- The number of days of activity to calculate
        default -- The status to use as the base status

        Keyword Arguments
        start   -- The day to look before (defaults to today)

        This funciton is currently only used on the front page
        
Return the past n days of activity AFTER the start date.
Arguments:
days    -- The number of days of activity to calculate
default -- The status to use as the base status

Keyword Arguments
start   -- The day to look before (defaults to today)

This funciton is currently only used on the front page
Return the past n days of activity AFTER the start date . Arguments : days -- The number of days of activity to calculate default -- The status to use as the base status Keyword Arguments start -- The day to look before ( defaults to today ) This funciton is currently only used on the front page
def history(self, days, default, start=None):
        start = start or date.today()
        ago = start - timedelta(days=days)
        events = self.events.filter('start >=', ago) \
            .filter('start <', start).fetch(100)
        stats = {}
        for i in range(days):
            start = start - timedelta(days=1)
            stats[start.day] = {
                "image": default.image,
                "name": default.name,
                "day": start,
                "information": False,
            }
        for event in events:
            if event.status.slug != default.slug:
                stats[event.start.day]["image"] = "icons/fugue/information.png"
                stats[event.start.day]["information"] = True
                stats[event.start.day]["name"] = "information"
        history = stats.values()
        history.sort()
        history.reverse()
        return history
def history ( self , days , default , start = None ) : start = start or date . today ( ) ago = start - timedelta ( days = days ) events = self . events . filter ( 'start >=' , ago ) . filter ( 'start <' , start ) . fetch ( 100 ) stats = { } for i in range ( days ) : start = start - timedelta ( days = 1 ) stats [ start . day ] = { "image" : default . image , "name" : default . name , "day" : start , "information" : False , } for event in events : if event . status . slug != default . slug : stats [ event . start . day ] [ "image" ] = "icons/fugue/information.png" stats [ event . start . day ] [ "information" ] = True stats [ event . start . day ] [ "name" ] = "information" history = stats . values ( ) history . sort ( ) history . reverse ( ) return history
Return the past n days of activity AFTER the start date.
Return the past n days of activity AFTER the start date .
""" Return the past n days of activity AFTER the start date.

        Arguments:
        days    -- The number of days of activity to calculate
        default -- The status to use as the base status

        Keyword Arguments
        start   -- The day to look before (defaults to today)

        This funciton is currently only used on the front page
        """
self
days
default
start