Hello again!

I am using Web2py 1.95.1 on Windows XP, inside Internet Explorer 7.

While researching the capabilities of SQLFORM, i have stumbled upon
one strange thing:
when i used deletable=True in a SQLFORM, there was no checkbox
visible, while rendering the form.

The form renders fine. Just the 'Check to delete:' checkbox is
missing.

That is the code, in which the problem was exposed:

# model
# db.py
# -----------------------------------------------------------------
db = DAL('sqlite://address.sqlite')

db.define_table('person',
                    Field('name', requires=IS_NOT_EMPTY())
               )

db.define_table('address',
                    Field('country'),
                    Field('city'),
                    Field('zip', requires=IS_INT_IN_RANGE(1000,9999,
                                    error_message=T('please insert a
valid ZIP code'))),
                    Field('mainaddr', requires=IS_NOT_EMPTY())
                )

# controller
# delete_data.py
# ----------------------------------------------------------------
def delete():
    delete_person=db.person(request.args(0))
    form1=SQLFORM(db.person, delete_person, deletable=True)

    delete_address=db.address(request.args(0))
    form2=SQLFORM(db.address, delete_address, deletable=True)

    return dict(form1=form1, form2=form2)

# view
# delete_data/delete.html
# -----------------------------------------------------------------
{{=form1}}
<br>
{{=form2}}

Reply via email to