예제 #1
0
 def test_render_template_paths(self):
     os.chdir(BASE)
     self.assertEqual(['{"a": 1}'], robaccia.render({}, self._start_response, "list.json", {"a": 1}))
     robaccia.TEMPLATE_DIRS = [os.path.join("tests", "input", "templates")]
     self.assertEqual(
         ["<html><body><p>Hello World!</p></body></html>"],
         robaccia.render({}, self._start_response, "list.html", {"a": 1}, raw_etag="foo"),
     )
예제 #2
0
 def test_render_template_paths(self):
     os.chdir(BASE)
     self.assertEqual(['{"a": 1}'],
                      robaccia.render({}, self._start_response, 'list.json',
                                      {'a': 1}))
     robaccia.TEMPLATE_DIRS = [os.path.join("tests", "input", "templates")]
     self.assertEqual(['<html><body><p>Hello World!</p></body></html>'],
                      robaccia.render({},
                                      self._start_response,
                                      'list.html', {'a': 1},
                                      raw_etag="foo"))
예제 #3
0
def list(environ, start_response):
    rows = model.entry_table.select().execute()
    rows = [{"id": 1, "title": "title", "content": "content", "updated": "updated"}]
    print rows, '------------------------'
    return robaccia.render(start_response, 'list.html', locals())
예제 #4
0
def member_get(environ, start_response):
    id = environ['selector.vars']
    row = model.entry_table.select(model.entry_table.c.id==id).execute().fetchone()
    return robaccia.render(start_response, 'entry.html', locals())
예제 #5
0
def list(environ, start_response):
    rows = model.entry_table.select().execute()
    return robaccia.render(start_response, 'list.html', locals())
예제 #6
0
def list(environ, start_response):
    rows = [row.title or " " for row in table.select(limit=5).execute()]
    if len(rows) < 5:
        rows.extend(["_"] * (5 - len(rows)))
    return robaccia.render(start_response, 'list.xhtml', locals())
예제 #7
0
def list(environ, start_response):
    print("Request to list the content in table.")
    rows = model.entry_table.select().execute()
    return robaccia.render(start_response, 'list.html', locals())
예제 #8
0
def list(environ, start_response):
    rows = model.entry_table.select().execute()
    return robaccia.render(start_response, 'list.html', locals())