Hi Rajesh,

That worked brilliantly...the number of queries has been massively
reduced now that I've taken your suggestion to eliminate the
serialization.

Thanks a lot for that! Very much appreciated.

Kind regards,

Mike.

On Sep 30, 6:45 pm, Rajesh Dhawan <[EMAIL PROTECTED]> wrote:
> > Thanks for your help so far - that definitely improved things
> > somewhat!
>
> Great.
>
>
>
> > However, I'm still having a slight problem. When I pass
> > Item.objects.get(id=id) into the serializers.serialize( ... )
> > function, it tells me that the Item is not iterable (this is why I was
> > originally using filter() in the first place, in order to make it
> > iterable). So a second ago I just tried encasing the
> > Item.objects.get(id=id) into a list [] and this worked. However, that
> > seems like a bit of a hack, or even that I'm not using the function
> > correctly. Is there a better approach to take here?
>
> You don't need the serializer at all since you're caching just a
> single item instance... Just do:
>
> cache.set(cache_key, item_obj, 30)
>
> Sorry, I should've mentioned this in my previous post.
>
> -RD
--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to