Example #1
0
def _is_card_on(r_card_id,on_card_ids):
    r_card_id = string_util.to_unicode(r_card_id)
    if on_card_ids:
        on_card_list = on_card_ids.split(',')
        for _on_card in on_card_list:
            if string_util.to_unicode(_on_card) == r_card_id:
                return True
    return False
    
Example #2
0
def _is_list_in(_list_a,_list_b):
    if _list_a and _list_b:
        total = len(_list_a)
        count = 0
        for a in _list_a:
            a = string_util.to_unicode(a)
            for b in _list_b:
                b = string_util.to_unicode(b)
                if a == b:
                    count += 1
                    break
        if total == count:
            return True
    return False
Example #3
0
def _card_name_exist(_card_name,card_list):
    for _card in card_list:
        if string_util.to_unicode(_card.name) == string_util.to_unicode(_card_name):
            return _card.id
    return None