(self, db, params)
return self._referrer_aggregate
Referrer aggregate for the passed link id
        :param db:
        :param params:
        :return:
Referrer aggregate for the passed link id
        :param db:
        :param params:
        :return:
Referrer aggregate for the passed link id : param db : : param params : : return :
def referrer_aggregate(self, db, params):
        """Referrer aggregate for the passed link id
        :param db:
        :param params:
        :return:
        """
        if self._referrer_aggregate is None:
            qry = text("""
                SELECT COALESCE(referrer, 'others'), COUNT(*) FROM clickmeta
                WHERE link_id=:link_id
                GROUP BY referrer
                ORDER BY count(*) DESC""")
            self._referrer_aggregate = dict(db.execute(qry, params).fetchall())
        return self._referrer_aggregate
def referrer_aggregate ( self , db , params ) : if self . _referrer_aggregate is None : qry = text ( """
                SELECT COALESCE(referrer, 'others'), COUNT(*) FROM clickmeta
                WHERE link_id=:link_id
                GROUP BY referrer
                ORDER BY count(*) DESC""" ) self . _referrer_aggregate = dict ( db . execute ( qry , params ) . fetchall ( ) ) return self . _referrer_aggregate