This would delete all posts by current user for example: db(db.posts.author==auth.user_id).delete()
On Apr 19, 7:12 pm, claudio <grossep...@googlemail.com> wrote: > I have a newbie question: How can I create a form to delete selected > entries from a database? Can I use SQLFORM for this? > > I have tables roughly like this in db.py > > db.define_table('person', > Field('name')) > > db.define_table('posts', > Field('title'), > Field('author',db.person)) > > and in default.py a function that should create the form and then > delete the picked entry > def delEntry: > > form=SQLFORM((db.posts.author==session.authorized).select(),fields=['posts']) > > -- > Subscription settings:http://groups.google.com/group/web2py/subscribe?hl=en