Edgewall Software

Opened 9 years ago

Closed 9 years ago

Last modified 6 years ago

#49 closed defect (fixed)

Lazy py:match

Reported by: waldemar.osuch@… Owned by: cmlenz
Priority: major Milestone: 0.3
Component: Template processing Version: 0.2
Keywords: Cc:


When using the recipe http://markup.edgewall.org/wiki/MarkupRecipes/FormFilling the form stops to be autofilled after three inputs. Got tired? :)

from markup.template import Template

<html xmlns:py="http://markup.edgewall.org/">

<input py:match="form//input" py:attrs="select('@*')" value="${form[str(select('@name'))]}" />

    <form action="" method="POST">
        <tr py:for="fn in sorted(form)">
            <td py:content="fn.capitalize()">Label:</td><td><input type="text" name="${fn}"/></td>
    <input type="submit" value="Save"/>

tmpl = Template(src)
form = dict(('hello_%s' % i, i) for i in range(5))
print tmpl.generate(**dict(form=form)).render(method='html')


    <form action="" method="POST">
            <td>Hello_0</td><td><input value="0" type="text" name="hello_0"></td>
            <td>Hello_1</td><td><input value="1" type="text" name="hello_1"></td>
            <td>Hello_2</td><td><input value="2" type="text" name="hello_2"></td>
            <td>Hello_3</td><td><input type="text" name="hello_3"></td>
            <td>Hello_4</td><td><input type="text" name="hello_4"></td>
    <input type="submit" value="Save">

Attachments (0)

Change History (1)

comment:1 Changed 9 years ago by cmlenz

  • Resolution set to fixed
  • Status changed from new to closed

Thanks for the report! This should be fixed in [273].

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain cmlenz.
The resolution will be deleted. Next status will be 'reopened'.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.