Rending a single text input

8 views
Skip to first unread message

Terrence Brannon

unread,
Apr 13, 2015, 6:04:16 PM4/13/15
to nagare...@googlegroups.com
I'm confused as to why I cannot render a single text box in a form with this code:

from __future__ import with_statement

import os
from nagare import presentation

class Todo(object):
    pass

@presentation.render_for(Todo)
def render(self, h, *args):
    h.head << h.head.title('Up and Running !')

    h.head.css_url('/static/nagare/application.css')

    with h.div(id='body'):
        with h.form:
            h.input(value='12')

    return h.root

# ---------------------------------------------------------------

app = Todo

Alain Poirier

unread,
Apr 14, 2015, 12:31:29 AM4/14/15
to nagare...@googlegroups.com
The line:

h.input(value='12')

must be:

h << h.input(value=’12')

to attach the newly created 'input' node to its parent in the DOM tree.

Reply all
Reply to author
Forward
0 new messages