def __init__(self, indicator=None, group='everyone', provider=None, firsttime=None, lasttime=None, tags=None):
self.indicator = indicator
self.group = group
self.provider = provider
self.firsttime = firsttime
self.lasttime = lasttime
self.tags = tags
if isinstance(group, list):
self.group = group[0]
if isinstance(self.tags, list):
self.tags.sort()
self.tags = ','.join(self.tags)
if self.lasttime and isinstance(self.lasttime, basestring):
self.lasttime = arrow.get(self.lasttime).datetime
if self.firsttime and isinstance(self.firsttime, basestring):
self.firsttime = arrow.get(self.firsttime).datetime
# http://www.pythoncentral.io/sqlalchemy-orm-examples/
评论列表
文章目录