def test_view_count_plus(self): self.add_mess() aa = MWiki.get_by_uid(self.uid) for i in range(5): MWiki.view_count_plus(self.uid) bb = MWiki.get_by_uid(self.uid) assert aa.view_count + 5 <= bb.view_count self.tearDown()
def view(self, rec): ''' View the page. ''' kwd = { 'pager': '', } MWiki.view_count_plus(rec.uid) self.render('wiki_page/page_view.html', postinfo=rec, kwd=kwd, author=rec.user_name, format_date=tools.format_date, userinfo=self.userinfo, cfg=CMS_CFG)
def ajax_count_plus(self, slug): ''' post count plus one via ajax. ''' output = { 'status': 1 if MWiki.view_count_plus(slug) else 0, } return json.dump(output, self)
def j_count_plus(self, slug): output = {'status': 1 if MWiki.view_count_plus(slug) else 0} return json.dump(output, self)