django: select_related() on an already-existing object?
I suppose I can do:
def doit(obj): obj = obj.__class__.objects.select_related().get(id=obj.id) #1 db hit obj.long.chain.of.stuff #no db hits
But is there any nicer way?
I suppose I can do:
def doit(obj): obj = obj.__class__.objects.select_related().get(id=obj.id) #1 db hit obj.long.chain.of.stuff #no db hits
But is there any nicer way?