• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python tdb_sql.index_str函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python tdb_sql.make_metadata函数代码示例发布时间:2022-05-26
下一篇:
Python tdb_sql.create_table函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap