Exemplo n.º 1
0
class showout_recent(tornado.web.UIModule):
    def render(self,
               cat_id,
               num=10,
               with_catalog=True,
               with_date=True,
               width=160,
               height=120):
        self.mpost = MPost()
        self.mpost2cat = MPost2Catalog()
        # recs = self.mpost2cat.query_by_catid(cat_id)
        recs = self.mpost.query_cat_recent(cat_id, num)

        kwd = {
            'with_catalog': with_catalog,
            'with_date': with_date,
            'width': width,
            'height': height,
        }

        return self.render_string(
            'tplite/modules/showout_list.html',
            recs=recs,
            kwd=kwd,
        )
Exemplo n.º 2
0
class showout_recent(tornado.web.UIModule):
    def render(self,
               cat_id,
               num=10,
               with_catalog=True,
               with_date=True,
               width=160,
               height=120):
        self.mpost = MPost()
        self.mpost2cat = MPost2Catalog()
        recs = self.mpost.query_cat_recent(cat_id, num)

        kwd = {
            'with_catalog': with_catalog,
            'with_date': with_date,
            'width': width,
            'height': height,
        }

        return self.render_string(
            '{0}/modules/showout_list.html'.format(
                config.torlite_template_name),
            recs=recs,
            unescape=tornado.escape.xhtml_unescape,
            kwd=kwd,
        )
Exemplo n.º 3
0
class post_category_recent(tornado.web.UIModule):
    def render(self, cat_id, num=10, with_catalog=True, with_date=True):
        self.mpost = MPost()
        self.mpost2cat = MPost2Catalog()
        recs = self.mpost.query_cat_recent(cat_id, num)
        kwd = {
            'with_catalog': with_catalog,
            'with_date': with_date,
        }
        return self.render_string('{0}/modules/post_list.html'.format(config.torlite_template_name),
                                  recs=recs,
                                  kwd=kwd, )
Exemplo n.º 4
0
class post_category_recent(tornado.web.UIModule):
    def render(self, cat_id, num=10, with_catalog=True, with_date=True):
        self.mpost = MPost()
        self.mpost2cat = MPost2Catalog()
        # recs = self.mpost2cat.query_by_catid(cat_id)
        recs = self.mpost.query_cat_recent(cat_id, num)
        kwd = {
            'with_catalog': with_catalog,
            'with_date': with_date,
        }
        return self.render_string('tplite/modules/post_list.html',
                                  recs=recs,
                                  kwd=kwd, )
Exemplo n.º 5
0
class post_category_recent(tornado.web.UIModule):
    def render(self, cat_id, num=10, with_catalog=True, with_date=True):
        self.mpost = MPost()
        self.mpost2cat = MPost2Catalog()
        # recs = self.mpost2cat.query_by_catid(cat_id)
        recs = self.mpost.query_cat_recent(cat_id, num)
        kwd = {
            'with_catalog': with_catalog,
            'with_date': with_date,
        }
        return self.render_string('tplite/modules/post_list.html',
                                  recs=recs,
                                  kwd=kwd, )
Exemplo n.º 6
0
class showout_recent(tornado.web.UIModule):
    def render(self, cat_id, num=10, with_catalog=True, with_date=True, width=160, height=120):
        self.mpost = MPost()
        self.mpost2cat = MPost2Catalog()
        recs = self.mpost.query_cat_recent(cat_id, num)

        kwd = {
            'with_catalog': with_catalog,
            'with_date': with_date,
            'width': width,
            'height': height,
        }

        return self.render_string('{0}/modules/showout_list.html'.format(config.torlite_template_name),
                                  recs=recs,
                                  unescape=tornado.escape.xhtml_unescape,
                                  kwd=kwd, )
Exemplo n.º 7
0
class showout_recent(tornado.web.UIModule):
    def render(self, cat_id, num=10, with_catalog=True, with_date=True, width=160, height=120):
        self.mpost = MPost()
        self.mpost2cat = MPost2Catalog()
        # recs = self.mpost2cat.query_by_catid(cat_id)
        recs = self.mpost.query_cat_recent(cat_id, num)

        kwd = {
            'with_catalog': with_catalog,
            'with_date': with_date,
            'width': width,
            'height': height,
        }

        return self.render_string('tplite/modules/showout_list.html',
                                  recs=recs,
                                  kwd=kwd, )
Exemplo n.º 8
0
class IndexHandler(tornado.web.RequestHandler):
    def initialize(self):
        self.mpost = MPost()
        self.mcat = MCatalog()

    def get(self, input=''):
        if input == '':
            self.index()
        else:
            self.render('/html/404.html')

    def index(self):
        dbdata = self.mpost.query_cat_recent(5, 16)
        recent = self.mpost.query_recent(8)
        self.render('tplite/index/index.html',
                    view=dbdata,
                    recent=recent,
                    unescape=tornado.escape.xhtml_unescape,
                    format_yr=tools.format_yr)