On 8/2/07, z0n3z00t <[EMAIL PROTECTED]> wrote:
> In the interest of anyone following this issue, I must confess that my
> previous solution broke down the minute I deployed it.  What was
> interesting was that the `painful thing` - finding  the context from
> which the __set__ is called, proved an impossible task without a
> framework hook.

This isn't entirely accurate. What I notice in your code is that you
were storing the _descrypted flag on the descriptor object itself,
which exists as a single instance for all instances of your model.
Instead, you'd need to store the flag as an attribute on each
individual model instance after the descriptor is first accessed. I
ran into this same problem.[1]

The solution that was pointed out to me was get_cache_name(). It's
undocumented, but is used for ReverseSingleRelatedObjectDescriptor
internally. One of my patches[2] shows how I used it. That patch
probably won't go into Django as is, but it shows how you can tackle
that problem successfully without hacking QuerySets.

-Gul

[1] 
http://groups.google.com/group/django-developers/browse_thread/thread/93fc74069e10aa17
[2] http://code.djangoproject.net/attachment/ticket/3982/lazy_attribute.diff

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@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-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to