Esempio n. 1
0
File: post.py Progetto: lf8289/white
 def serach_count(self, key):
     q = db.select(self.table).fields(db.expr('count(*)',
             'total')).condition('status', 'published')
     _or = db.or_()
     _or.condition('slug', '%%%s%%' % key, 'LIKE').condition('title', '%%%s%%' % key, 'LIKE')
     q.condition(_or)
     return q.execute()[0][0]
Esempio n. 2
0
File: post.py Progetto: zgwdg/white
 def serach_count(self, key):
     q = db.select(self.table).fields(db.expr('count(*)',
                                              'total')).condition(
                                                  'status', 'published')
     _or = db.or_()
     _or.condition('slug', '%%%s%%' % key,
                   'LIKE').condition('title', '%%%s%%' % key, 'LIKE')
     q.condition(_or)
     return q.execute()[0][0]
Esempio n. 3
0
File: post.py Progetto: zgwdg/white
 def count(self, status=None):
     q = db.select(self.table).fields(db.expr('COUNT(*)'))
     if status:
         q.condition('status', status)
     return q.execute()[0][0]
Esempio n. 4
0
File: post.py Progetto: zgwdg/white
 def category_count(self, category_id):
     return db.select(self.table).fields(db.expr(
         'count(*)', 'total')).condition('category', category_id).condition(
             'status', 'published').execute()[0][0]
Esempio n. 5
0
 def spam_count(self, domain):
     return db.select(self.table).fields(db.expr('COUNT(*)')).condition(
         'email', domain, 'LIKE').execute()[0][0]
Esempio n. 6
0
 def count(self):
     return db.select(self.table).fields(
         db.expr('COUNT(*)')).execute()[0][0]
Esempio n. 7
0
 def count(self, **kw):
     q = db.select(self.table).fields(db.expr('COUNT(*)'))
     if kw:
         for k, v in kw.iteritems():
             q.condition(k, v)
     return q.execute()[0][0]
Esempio n. 8
0
 def count(self):
     return db.select(self.table).fields(db.expr('COUNT(*)')).execute()[0][0]
Esempio n. 9
0
 def count_slug(self, slug):
     return db.select(self.table).fields(db.expr('COUNT(*)')).condition('slug', slug).execute()[0][0]
Esempio n. 10
0
File: page.py Progetto: lf8289/white
 def count(self, status=None):
     q= db.select(self.table).fields(db.expr('COUNT(*)'))
     if status != 'all':
         q.condition('status', status)
     return q.execute()[0][0]
Esempio n. 11
0
File: post.py Progetto: lf8289/white
 def category_count(self, category_id):
     return db.select(self.table).fields(db.expr('count(*)',
         'total')).condition('category', category_id).condition('status', 'published').execute()[0][0]
Esempio n. 12
0
 def count(self, **kw):
     q = db.select(self.table).fields(db.expr('COUNT(*)'))
     if kw:
         for k, v in kw.iteritems():
             q.condition(k, v)
     return q.execute()[0][0]
Esempio n. 13
0
 def spam_count(self, domain):
     return db.select(self.table).fields(db.expr('COUNT(*)')).condition('email', domain, 'LIKE').execute()[0][0]