本文整理汇总了Python中pycassa.columnfamily.ColumnFamily.column_validators['added']方法的典型用法代码示例。如果您正苦于以下问题:Python ColumnFamily.column_validators['added']方法的具体用法?Python ColumnFamily.column_validators['added']怎么用?Python ColumnFamily.column_validators['added']使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pycassa.columnfamily.ColumnFamily
的用法示例。
在下文中一共展示了ColumnFamily.column_validators['added']方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ConnectionPool
# 需要导入模块: from pycassa.columnfamily import ColumnFamily [as 别名]
# 或者: from pycassa.columnfamily.ColumnFamily import column_validators['added'] [as 别名]
from filters import slugify, splitter, onlychars, get_first_part, get_last_part, formattime, cleanurl
import urllib2
import json
import datetime
import redis
r = redis.Redis()
from pycassa.pool import ConnectionPool
from pycassa.columnfamily import ColumnFamily
from pycassa.types import *
# database terms
pool_terms = ConnectionPool('Terms', ['162.243.79.52:9160'])
col_term = ColumnFamily(pool_terms, 'Term')
col_term.column_validators['added'] = DateType()
col_term.column_validators['hits'] = IntegerType()
# database berita
pool_topics = ConnectionPool('Topics', ['162.243.79.52:9160'])
col_topic = ColumnFamily(pool_topics, 'Topic')
@app.template_filter()
def slug(s):
"""
transform words into slug
usage: {{ string|slug }}
"""
return slugify(s)