On 6/28/07, psnively <[EMAIL PROTECTED]> wrote:
>
> > In that case the keyword has no meaning anymore. I rather suggest you
> > create your own relationship type (inheriting from
> > HasAndBelongsToMany) with whatever keyword suits you. I just commited
> > a little change (r136) which should make this easier.
> >
> > With this change, something along the lines of:
> >
> > class HasAndBelongsToOne(HasAndBelongsToMany):
> >     uselist = False
> >
> > has_and_belongs_to_one = Statement(HasAndBelongsToOne)
> >
> > shoud work. I'm not sure I want to include this in the main
> > distribution though. If you come up with a better name than
> > "HasAndBelongsToOne", I'll probably do though ;-).
>
> This is a good point. Hmmm. What about changing
> "has_and_belongs_to_many" to "has_and_belongs_to," with my patch? This
> way it's:
>
> 1) More flexible
> 2) Consistent with the documentation
> 3) Consistent with other Elixir/SQLAlchemy usage involving the uselist
> keyword argument

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.

> 4) More appropriately named
>
> As things stand at the moment, though, Elixir doesn't have a means of
> describing a bidirectional 1-to-1 association, and this doesn't seem
> to me to rise to the level of suggesting a fork--at all. At the
> moment, however, that's what we have, and what you seem to be
> suggesting.

There is a huge difference between a fork and using a patched version.
Besides, I didn't suggest anything particular in that area. There are
other options... For example, you could add this code in your
application code, or maybe in a little library on top of elixir if you
prefer...
-- 
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