On Mon, 2009-08-03 at 08:10 -0700, lfrodrigues wrote: > Isn't there any way to cache profile data on User side?
This already happens when you call get_profile(). If you mean using a mass query, then you have just asked if there is a select_related() equivalent for reverse relations. For the answer to that, see my previous mail in this thread. > When are you > planning on closing 7270? When it is appropriate. The patch needs some fixing and it didn't make the cut for 1.1. It's a good candidate for 1.2, but the answer is always "when it's ready". > > A lot of my code uses get_profile in templates and that is always a > query. Isn't it possible to optimize this? Everything is possible. Asking the same question three or four times isn't the way to do it, however. It's been explained in this thread what you can do at the moment. Querying UserProfile instead of User is a very practical technique. Some quite large sites use it in that fashion (I'm not at liberty to disclose names, so you can trust me or not). Does this mean you can just pass around a bunch of User objects and not have to do any code changes? No. But optimisation almost always involves some code changes and passing around UserProfiles instead isn't particularly illogical. Regards, Malcolm --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---