Hi,

I don't know if the way I add users is proper, but it works. Now I try
to write a <a> tag for deleting users, and it doesn't work. Here is
the code:

==in a controller file==
def admin():
        records = db().select(custom_auth_table.ALL,
orderby=custom_auth_table.username)
        #records = SQLFORM(custom_auth_table, user, deletable=True)
        form = SQLFORM(db[auth.settings.table_user_name])
        if form.accepts(request.post_vars, session):
                session.flash = 'Address saved.'
                redirect(URL('admin'))
        return dict(form=form, records=records)
========

==admin.html==
{{extend 'layout.html'}}
Add a user: <br>
{{=form}}
<br><br>
Users:
<br>
{{for record in records:}}
{{=record.username}} : {{=record.password}}
 [
<a href="#"
onclick="ajax('{{=URL('db[auth.remove.record.username]')}}',
[],'')">Delete this user</a>
]
<br>
{{pass}}
========

Thanks in advance for help

Reply via email to