Q:

Delete a child object in Django database

Costumer and Worker models. Costumer inherited from User, and Worker inherited from Costumer, when I do 
 worker.delete(), 

it will delete all the related object in all three tables, how can I do, it will only delete the data in Worker table, and data in rest of tables remain(assume, one costumer doesnt want be a worker longer, but he still want to be a costumer)

A:

I don't think there's a built-in way to 'demote' a model to a superclass, nor to 'promote' a model to a subclass.
If you need to modify the original records, rather than creating a new set, you'll probably have to use a raw query like...
DELETE FROM <the_worker_table_name> WHERE id=<the_worker_object_id>

...then re-select the object as type Costumer for any further processing.

