On 3/9/06, Luke Plant <[EMAIL PROTECTED]> wrote:
>
> On Tuesday 07 March 2006 14:49, Russell Keith-Magee wrote:
>
> > > > 3) What is to become of the _id fields for ForeignKeys?

> > Isn't this covered by descriptor caching? One initial DB hit to get
> > the related object, and then all subsequent requests for the id come
> > from the cache. Or am I missing something here?
>
> The thing you are missing is that often you only want the id, and you
> don't want to do that initial hit to get the related object at all.

Understood. As an added bonus, I now understand what you were getting
at with your lazy object talk earlier in this thread, and now that I
understand, I rather like the idea. Like you said, there are a few
details to work out, but with some creative property handlers it
should be possible, could be quite elegant, and would get rid of the
_id/.id schism (which still bugs me at an aesthetic level).

Once I've finished implementing descriptor details from this thread,
I'll have a bit of a play, see what falls out, and report back.

Speaking of descriptors - we appear to have reached relative consensus on:
- article_set = [a,b,c] notation
- DoesNotExist thrown only when null isn't a valid value
- _id stays

I'll work up patches for these in the coming days.

We also seem to have a consensus on implicit save(), but we also have
a consensus that it is only the best of some bad options. In light of
that, I'm tempted to stick with the status quo.

However, nobody has commented on my revised 'commit ForeignKey changes
immediately' idea (i.e., make SQL calls to modify ForeignKeys as soon
as add/clear is called, in the same way that they are for m2m fields).
Does anyone want to comment on this, or is the idea really _that_ bad?
:-)

Russ Magee %-)

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to