本文整理汇总了Python中r2.lib.db.tdb_sql.index_str函数的典型用法代码示例。如果您正苦于以下问题:Python index_str函数的具体用法?Python index_str怎么用?Python index_str使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了index_str函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, force = False):
engine = g.dbm.get_engine('email')
self.metadata = make_metadata(engine)
self.queue_table = mail_queue(self.metadata)
indices = [index_str(self.queue_table, "date", "date"),
index_str(self.queue_table, 'kind', 'kind')]
create_table(self.queue_table, indices)
self.opt_table = opt_out(self.metadata)
indices = [index_str(self.opt_table, 'email', 'email')]
create_table(self.opt_table, indices)
self.track_table = sent_mail_table(self.metadata)
self.reject_table = sent_mail_table(self.metadata, name = "reject_mail")
def sent_indices(tab):
indices = [index_str(tab, 'to_addr', 'to_addr'),
index_str(tab, 'date', 'date'),
index_str(tab, 'ip', 'ip'),
index_str(tab, 'kind', 'kind'),
index_str(tab, 'fullname', 'fullname'),
index_str(tab, 'account_id', 'account_id'),
index_str(tab, 'msg_hash', 'msg_hash'),
]
create_table(self.track_table, sent_indices(self.track_table))
create_table(self.reject_table, sent_indices(self.reject_table))
开发者ID:asdfjasdjkfl,项目名称:reddit,代码行数:27,代码来源:mail_queue.py
示例2: __init__
def __init__(self, force=False):
engine = g.dbm.get_engine("email")
self.metadata = make_metadata(engine)
self.queue_table = mail_queue(self.metadata)
indices = [index_str(self.queue_table, "date", "date"), index_str(self.queue_table, "kind", "kind")]
create_table(self.queue_table, indices)
self.opt_table = opt_out(self.metadata)
indices = [index_str(self.opt_table, "email", "email")]
create_table(self.opt_table, indices)
self.track_table = sent_mail_table(self.metadata)
self.reject_table = sent_mail_table(self.metadata, name="reject_mail")
def sent_indices(tab):
indices = [
index_str(tab, "to_addr", "to_addr"),
index_str(tab, "date", "date"),
index_str(tab, "ip", "ip"),
index_str(tab, "kind", "kind"),
index_str(tab, "fullname", "fullname"),
index_str(tab, "account_id", "account_id"),
index_str(tab, "msg_hash", "msg_hash"),
]
create_table(self.track_table, sent_indices(self.track_table))
create_table(self.reject_table, sent_indices(self.reject_table))
开发者ID:pra85,项目名称:reddit,代码行数:27,代码来源:mail_queue.py
示例3: make_change_tables
def make_change_tables(force = False):
metadata = make_metadata(change_engine)
table = change_table(metadata)
indices = [
index_str(table, 'fullname', 'fullname'),
index_str(table, 'date', 'date')
]
create_table(table, indices, force = force)
return table
开发者ID:EeroHeikkinen,项目名称:ikaros,代码行数:9,代码来源:thing_changes.py
示例4: make_query_queue_table
def make_query_queue_table():
metadata = make_metadata(query_queue_engine)
table = sa.Table(settings.DB_APP_NAME + '_query_queue', metadata,
sa.Column('iden', sa.String, primary_key = True),
sa.Column('query', sa.Binary),
sa.Column('date', sa.DateTime(timezone = True)))
date_idx = index_str(table, 'date', 'date')
create_table(table, [date_idx])
return table
开发者ID:Craigus,项目名称:lesswrong,代码行数:9,代码来源:query_queue.py
示例5: make_query_queue_table
def make_query_queue_table():
engine = g.dbm.engines['query_queue']
metadata = make_metadata(engine)
table = sa.Table(g.db_app_name + '_query_queue', metadata,
sa.Column('iden', sa.String, primary_key = True),
sa.Column('query', sa.Binary),
sa.Column('date', sa.DateTime(timezone = True)))
date_idx = index_str(table, 'date', 'date')
create_table(table, [date_idx])
return table
开发者ID:rajbot,项目名称:tikical,代码行数:10,代码来源:query_queue.py
示例6: sent_indices
def sent_indices(tab):
indices = [index_str(tab, 'to_addr', 'to_addr'),
index_str(tab, 'date', 'date'),
index_str(tab, 'ip', 'ip'),
index_str(tab, 'kind', 'kind'),
index_str(tab, 'fullname', 'fullname'),
index_str(tab, 'account_id', 'account_id'),
index_str(tab, 'msg_hash', 'msg_hash'),
]
开发者ID:asdfjasdjkfl,项目名称:reddit,代码行数:9,代码来源:mail_queue.py
示例7: sent_indices
def sent_indices(tab):
indices = [
index_str(tab, "to_addr", "to_addr"),
index_str(tab, "date", "date"),
index_str(tab, "ip", "ip"),
index_str(tab, "kind", "kind"),
index_str(tab, "fullname", "fullname"),
index_str(tab, "account_id", "account_id"),
index_str(tab, "msg_hash", "msg_hash"),
]
开发者ID:pra85,项目名称:reddit,代码行数:10,代码来源:mail_queue.py
示例8: make_metadata
METADATA = make_metadata(ENGINE)
gold_table = sa.Table('reddit_gold', METADATA,
sa.Column('trans_id', sa.String, nullable = False,
primary_key = True),
# status can be: invalid, unclaimed, claimed
sa.Column('status', sa.String, nullable = False),
sa.Column('date', sa.DateTime(timezone=True),
nullable=False),
sa.Column('payer_email', sa.String, nullable = False),
sa.Column('paying_id', sa.String, nullable = False),
sa.Column('pennies', sa.Integer, nullable = False),
sa.Column('secret', sa.String, nullable = True),
sa.Column('account_id', sa.String, nullable = True))
indices = [index_str(gold_table, 'status', 'status'),
index_str(gold_table, 'date', 'date'),
index_str(gold_table, 'account_id', 'account_id'),
index_str(gold_table, 'secret', 'secret', unique = True),
index_str(gold_table, 'payer_email', 'payer_email')]
create_table(gold_table, indices)
def create_unclaimed_gold (trans_id, payer_email, paying_id,
pennies, secret, date):
gold_table.insert().execute(trans_id=trans_id,
status="unclaimed",
payer_email=payer_email,
paying_id=paying_id,
pennies=pennies,
secret=secret,
date=date)
开发者ID:JediWatchman,项目名称:reddit,代码行数:31,代码来源:gold.py
示例9: index_str
sa.Column('trans_id', sa.String, nullable = False,
primary_key = True),
# status can be: invalid, unclaimed, claimed
sa.Column('status', sa.String, nullable = False),
sa.Column('date', sa.DateTime(timezone=True),
nullable = False,
default = sa.func.now()),
sa.Column('payer_email', sa.String, nullable = False),
sa.Column('paying_id', sa.String, nullable = False),
sa.Column('pennies', sa.Integer, nullable = False),
sa.Column('secret', sa.String, nullable = True),
sa.Column('account_id', sa.String, nullable = True),
sa.Column('days', sa.Integer, nullable = True),
sa.Column('subscr_id', sa.String, nullable = True))
indices = [index_str(gold_table, 'status', 'status'),
index_str(gold_table, 'date', 'date'),
index_str(gold_table, 'account_id', 'account_id'),
index_str(gold_table, 'secret', 'secret'),
index_str(gold_table, 'payer_email', 'payer_email'),
index_str(gold_table, 'subscr_id', 'subscr_id')]
create_table(gold_table, indices)
class GoldRevenueGoalByDate(object):
__metaclass__ = tdb_cassandra.ThingMeta
_use_db = True
_cf_name = "GoldRevenueGoalByDate"
_read_consistency_level = tdb_cassandra.CL.ONE
_write_consistency_level = tdb_cassandra.CL.ALL
开发者ID:0xcd03,项目名称:reddit,代码行数:31,代码来源:gold.py
示例10: index_str
METADATA,
sa.Column("trans_id", sa.String, nullable=False, primary_key=True),
# status can be: invalid, unclaimed, claimed
sa.Column("status", sa.String, nullable=False),
sa.Column("date", sa.DateTime(timezone=True), nullable=False, default=sa.func.now()),
sa.Column("payer_email", sa.String, nullable=False),
sa.Column("paying_id", sa.String, nullable=False),
sa.Column("pennies", sa.Integer, nullable=False),
sa.Column("secret", sa.String, nullable=True),
sa.Column("account_id", sa.String, nullable=True),
sa.Column("days", sa.Integer, nullable=True),
sa.Column("subscr_id", sa.String, nullable=True),
)
indices = [
index_str(gold_table, "status", "status"),
index_str(gold_table, "date", "date"),
index_str(gold_table, "account_id", "account_id"),
index_str(gold_table, "secret", "secret", unique=True),
index_str(gold_table, "payer_email", "payer_email"),
index_str(gold_table, "subscr_id", "subscr_id"),
]
create_table(gold_table, indices)
def create_unclaimed_gold(trans_id, payer_email, paying_id, pennies, days, secret, date, subscr_id=None):
try:
gold_table.insert().execute(
trans_id=str(trans_id),
subscr_id=subscr_id,
开发者ID:tolgaek,项目名称:reddit,代码行数:31,代码来源:gold.py
注:本文中的r2.lib.db.tdb_sql.index_str函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论