Hi List,

I have a table defined in elixir, simplified as following:
class Widget(Entity):
    """Form, Fieldset or Field
    """
    has_field('name', Unicode(40), nullable=False, unique=True)
    has_and_belongs_to_many('children', of_kind='Widget',
inverse='parents')
    has_and_belongs_to_many('parents', of_kind='Widget',
inverse='children')

when i explicitly do join on that table like this:
>>> widgets = Widget.q.filter_by(id=1).join('children', aliased=True).all()

then I got:
DBAPIError: (ProgrammingError) missing FROM-clause entry for table
"widget_2"
LINE 2: ...ON widget_parents__widget_children_1.widget_id2 =
widget_2.i...

'SELECT widget.name AS widget_name, widget.id AS widget_id,\n
FROM widget LEFT OUTER JOIN widget_parents__widget_children AS
widget_parents__widget_children_1 ON
widget_parents__widget_children_1.widget_id2 = widget_2.id LEFT OUTER
JOIN widget AS widget_2 ON
widget_parents__widget_children_1.widget_id1 = widget_2.id\n
WHERE widget.id = %(widget_id)s' {'widget_id': 1}

It seems like the aliases are wrong.
and the PropertyAliasedClauses is to be blamed.

Is this a bug? or I didn't join things in the right way?

I don't know if here is the right list to post this problem. But I
think this problem is more SA related as Elixir.

Thanks in advance!

Best

Jian


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" 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/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to