SQLFORM has an argument called "deletable" if you set it to True when
you initialize it, you will have an option like "delete this record".
and when you submit the form with that option checked then the record
will be deleted.

On 20 Nisan, 03:12, 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

Reply via email to