Пример #1
0
def rec_read_new(po_id, tag_id):
    mq_rec_topic_has_new(tag_id)
    times = redis.hget(REDIS_REC_PO_TIMES, po_id)
    if times >= REDIS_REC_PO_SHOW_TIMES:
        _user_tag_old_rank(po_id, tag_id, times)
    else:
        redis.sadd(REDIS_REC_TAG_NEW%tag_id, po_id)
Пример #2
0
    def delete(self, tag_id):
        #print tag_id
        _tag_id_score_list = self._tag_id_score_list

        if _tag_id_score_list is None:
            return

        r = []
        for i in _tag_id_score_list:
            if i[0] == tag_id:
                continue
            r.append(i)

        self._tag_id_score_list = r
        user_id = self.user_id

        id_score_list_new(user_id, r)

        if tag_id:
            redis.sadd(REDIS_REC_TAG_USER_IS_EMPTY%tag_id, user_id)

        self._init_sample()
Пример #3
0
def _tag_alias_new(id, name):
    low = name.lower()
    redis.sadd(REDIS_ALIAS % id, low)
    redis.hset(REDIS_ALIAS_NAME2ID, low, id)
    from model.autocomplete import autocomplete_tag
    autocomplete_tag.append_alias(name, id)
Пример #4
0
def _tag_alias_new(id, name):
    low = name.lower()
    redis.sadd(REDIS_ALIAS%id, low)
    redis.hset(REDIS_ALIAS_NAME2ID, low, id)
    from model.autocomplete import  autocomplete_tag
    autocomplete_tag.append_alias(name, id)
Пример #5
0
def feed_import_user_new(user_id, feed_import_id):
    if redis.sadd(REDIS_FEED_IMPORT_USER_ID_LIST%user_id, feed_import_id):
        redis.zincrby(REDIS_FEED_IMPORT_USER, user_id, 1)
Пример #6
0
def feed_import_user_new(user_id, feed_import_id):
    if redis.sadd(REDIS_FEED_IMPORT_USER_ID_LIST % user_id, feed_import_id):
        redis.zincrby(REDIS_FEED_IMPORT_USER, user_id, 1)
Пример #7
0
def spammer_new(user_id):
    user_id = int(user_id)
    redis.sadd(SPAMMER_REDIS_KEY, user_id)
Пример #8
0
def spammer_new(user_id):
    user_id = int(user_id)
    redis.sadd(SPAMMER_REDIS_KEY, user_id)