You can do it,  but also consider what should happen to referenced records 
- be aware of any cascading deletes.  


On Monday, January 7, 2013 10:00:48 PM UTC, Daniele wrote:
>
> Well, I know I can do this from the admin interface but I was wondering 
> how a user can remove himself from the website if he so wishes.
>
> Should I put the code 
> `db(db.auth_user.email=="[email protected]<javascript:>").delete()` 
> in a {{=A(_href=action)}} or is that bad practice? I want the user to be 
> able to delete himself.
>
>
> On Mon, Jan 7, 2013 at 9:56 PM, Bruno Rocha <[email protected]<javascript:>
> > wrote:
>
>>
>> If you have shell access.
>>
>> Go to your shell
>>
>> python web2py.py -S yourappname -M
>>
>> >>> db(db.auth_user.email=="[email protected] <javascript:>").delete()
>> >>> db.commit()
>>
>> The user with "[email protected] <javascript:>" is now deleted!
>>
>> If you dont hace shell access, just go to your admi  interface, database 
>> adminitration and delete from auth_user table.
>>
>> -- 
>>  
>>  
>>  
>>
>
>

-- 



Reply via email to