1 # -*- coding: utf-8 -*-
3 # sufficient valueを保持するクラス
4 # 2013/12/04 written by kei9
8 class SufficientsHolder(object):
9 u""" ランダムのSeed値を保持するクラス """
10 def __init__(self, sufficient_list):
11 u""" sufficient_list: list of sufficient
13 self.sufficient_set = set(sufficient_list)
15 def get_where_sql(self, remove_where=False):
16 u""" SQLのWhere文に変換する(IN句) """
17 if len(self.sufficient_set) >= 1:
18 uni_list = [u"{0}".format(x) for x in self.sufficient_set]
19 sql = u" {col} IN({in_phrase})".format(
20 col=db_supports.SUFFICIENT_COL_SUFFICIENT_VALUE,
21 in_phrase=u",".join(uni_list))
26 return u" where" + sql