Given
event = Event.objects.filter(location=loc).first()
obviously loc and event.location refer to the same row in the db
event.location == loc
but they refer to separate instances
id(event.location) != id(loc) # they're separate instances.
this can be solve with a basic assign statement
event.location = loc
But I'm wondering if there's a way to change the default behavior. so that the queryset returned by a filter re-uses any instances that were passed to it. Perhaps that requires a lot of overhead, I haven't looked into it too deeply myself. I thought I'd post here first in case I'm missing something obvious.
thanks!