Another question has come to mind...I have the following code in my 
controller now:

if tform.process().accepted:
        if tform.vars.is_tutor:
            auth.add_membership('Tutors')
            db.auth_user.insert(
                a_bunch_of_fields = tform.vars.a_bunch_of_fields)
        else:
            # check if the user has membership first
            auth.del_membership('Tutors')
            db.auth_user.delete()

In the last line, db.auth_user.delete(), I'd like to delete all the fields 
in the database that I'd write if the is_tutor boolean is checked. But I'm 
wondering, I'd have to specify that it only needs to delete these for the 
logged in user. How can I do this? Also, is deleting the correct thing to 
do or should I just reset the values to a default, like "" or None ?

Thanks


On Monday, December 3, 2012 2:27:29 PM UTC, Daniele wrote:
>
> Hey guys, I'm wondering if there's a way from the controller to know 
> whether a form's boolean field (checkbox) is selected or not. I only want 
> to add the info in the form to the database if the checkbox is selected, 
> otherwise the controller should not process that form.
>
> Thanks!
>

-- 



Reply via email to