Here is a hit to remove.
I have both User and ProfileUser. I would like to add additional logic to the model, and since I cannot add it to the Django User model, I have to add it to ProfileUser. Currently, all my models have ForeignKey (User). Should I store them this way or should the user ForeignKey (UserProfile) on my other models?
An example for my view, if I save ForeignKey (User):
class myview(request):
user = request.user
userProfile = user.get_profile()
neededStuff = userProfile.get_needed_stuff()
and then in the UserProfile model:
def get_needed_stuff(self):
user= self.user
goals = Goal.objects.get(<conditions that i wont bother writing here>)
return goals
So, for this case and for the further development of the site, which should use a foreign key?
source
share