This is part of my Django application which is saving a user's profile in a special way.
class SomeUser:
def __init__(self, request):
self.logged_in = True
self.profile = request.user.get_profile()
self.favorites = self.profile.favorites.all().values_list('pk', flat=True)
def save(self, resp):
print "1: " + str(self.favorites)
self.profile.favorites = self.favorites
print "2: " + str(self.favorites)
self.profile.save()
return resp
Output:
1: [68, 56]
2: []
How is this even possible? I'm not fiddling with self.favorites
at all! How can its value change?
EDIT: Updated the question with more info.