Commit 64e187fd by Lyla Fischer

fixed default handling

parent ce5540b2
...@@ -8,7 +8,7 @@ class textline(object): ...@@ -8,7 +8,7 @@ class textline(object):
def render(element, value, state): def render(element, value, state):
eid=element.get('id') eid=element.get('id')
count = int(eid.split('_')[-2])-1 # HACK count = int(eid.split('_')[-2])-1 # HACK
size = element.get('size') or 0 size = element.get('size')
context = {'id':eid, 'value':value, 'state':state, 'count':count, 'size': size} context = {'id':eid, 'value':value, 'state':state, 'count':count, 'size': size}
html=render_to_string("textinput.html", context) html=render_to_string("textinput.html", context)
return etree.XML(html) return etree.XML(html)
......
<section class="text-input"> <section class="text-input">
<input type="text" name="input_${id}" id="input_${id}" value="${value}" size="${size}" /> <input type="text" name="input_${id}" id="input_${id}" value="${value}"
% if size
size="${size}"
% endif
/>
<span id="answer_${id}"></span> <span id="answer_${id}"></span>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment