I'm putting together my first 'real' project with the assignment
syntax, and with SQLAlchemy 0.4 no less, but so far everything is
working, a few DeprecationWarnings notwithstanding.

Gaeten: I forgot to mention this before, the problem with
associable.py was using sa.mapper, sa.relation, etc instead of the
sa.orm ones. It looks like that was already fixed in r194.

Overall I'm doing well and greatly preferring this to writing the
SQLAlchemy code by hand, but I've found the following somewhat
unintuitive:

    from elixir import *
    import sqlalchemy as sa
    
    engine = sa.create_engine("sqlite:///")
    metadata = sa.MetaData(engine)
    
    class Parent(Entity):
        child = OneToOne("Child", inverse="parent")
    
    class Child(Entity):
        parent = ManyToOne("Parent", inverse="parent")
    
    metadata.create_all()
    
Since what I want is a one-to-one on each field, it made more sense to
me that I'd define OneToOne on each field, rather than a OneToOne and
then a ManyToOne.

So far as I can tell, the reason for this interface is because
ManyToOne (I think) is the equivalent of the belongs_to statement,
which was only used on the *child* side of a relationship, while I
think most would expect OneToOne to be used on both the parent and the
child sides when doing a one-to-one relationship. 

I'm looking through relationships.py to see what kind of changes would
be needed for that, but I wanted to bounce that off here first to see
what everyone thinks.

Another thing to consider is a syntax like the following:

    class Parent(Entity):
        child = OneToOne("Child", inverse="parent")
    
    class Child(Entity):
        pass

I don't know if people would be opposed to the implicitness in that. I
don't really mind typing both sides of the relation, because I do
think of them as object attributes, but both SQLAlchemy and Django
will implicitly handle the inverse relation. That bothered me
slightly with both of them, so I would probably still type out both
sides, but it might be worth considering if Elixir should do the same.

Two more things: First, I get things more figured out I'd be happy to
work on some documentation, and second, how do I go about getting a
Trac account?

Thanks, 
Adam Gomaa
[EMAIL PROTECTED]

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