On 7/10/07, psnively <[EMAIL PROTECTED]> wrote:
>
> > Actually what you suggest is *not* consistent with the rest of Elixir,
> > as other relationship types all imply clearly if they point to one or
> > several entities.
>
> That's a fair point, especially in the current HEAD where it's now
> been made more clear that the "uselist" keyword argument is not
> actually available for use.

That change was not meant to discourage using uselist. It was meant to
make it possible to inherit from has_and_belongs_to_many and override
uselist.

> Personally, I would prefer that there not
> be distinct statements for the different cardinalities and that the
> use of "uselist" be left to the client. That is, you'd have "has,"
> "belongs_to," and "has_and_belongs_to," all nicely orthogonal, and
> with "has" and "has_and_belongs_to" taking "uselist," which would be
> nicely consistent with SQLAlchemy.
>
> But it's true that that would be a backward-incompatible change, so I
> find the introduction of "has_and_belongs_to_one" an acceptable
> compromise.
>
>
> Honestly, your reluctance to include "has_and_belongs_to_one" in
> Elixir seems to stem entirely from your belief that it is not
> semantically different from has_one/belongs_to, which is false, as I
> explained in my other reply. I hope, on that basis, that you'll
> reconsider.

Well, I finally understood what you meant. There is indeed a different
semantic to it. Sorry for not getting it earlier... Besides, I forgot
to tell you I made a change a few days ago which should allow you to
do _almost_ what you'd like: now keywords passed to the relationship
override those computed (or precoded) by Elixir. It means you should
be able to declare your relationship as:

has_and_belongs_to_many(..., uselist=False)

As for the has_and_belongs_to_one, if you provide a patch (with
documentation similar to the other relationship types), I'll include
it.
-- 
Gaƫtan de Menten
http://openhex.org

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"SQLElixir" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlelixir?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to