1π
β
It looks normal that Iβm deleting UserProfile rather than User. But I intended it to a proxy to actual User
Why not delete the User directly? By default, Django will CASCADE DELETE to get rid of the UserProfile as well.
Generally speaking, should I reference each models to User or UserProfile
I think this is more a question of personal preference, but I usually tie to User directly as it saves a step when getting to the object you want (you donβt need to do user.get_profile().student and can call user.student instead). It also makes more sense to me anyway: the student is a property of the user, not the userβs profile.
π€Tom
Source:stackexchange.com