If anybody else is experiencing this same problem, I have opened a Bug Request @ SQLA Trac and you can follow it through here:
http://www.sqlalchemy.org/trac/ticket/2260 On Aug 18, 1:56 am, Ygor Lemos <opti...@gmail.com> wrote: > Oh, sorry about that, I copied from a previous declaration I've been > testing using Table() objects... I did remove the ,'s and all worked > fine... The relationships are normal both in py3k and py2 with the > latest SQLA. So the problem really lies on the relate() method of > SqlSoup. > > Thanks again for your time. > > On Aug 18, 1:25 am, Michael Bayer <mike...@zzzcomputing.com> wrote: > > > > > > > > > On Aug 17, 2011, at 10:15 PM, Ygor Lemos wrote: > > > > I tried the following for manually mapping the tables: > > > > #!/usr/bin/env python3 > > > # -*- coding: utf-8 -*- > > > > from sqlalchemy import * > > > from sqlalchemy import dialects > > > from sqlalchemy import sql > > > from sqlalchemy.orm import * > > > from sqlalchemy.ext.declarative import declarative_base > > > from sqlalchemy.sql.expression import * > > > > engine = create_engine("mysql+oursql://XXXXXXXX:XXXXXXX@XXXXXXXXXXXXXX/ > > > XXXXXXX?charset=utf8&use_unicode=True&autoping=True", echo=True) > > > metadata = MetaData(engine) > > > > Base = declarative_base() > > > > class User(Base): > > > > __tablename__ = "users" > > > > id = Column(Integer, primary_key=True), > > > login = Column(String(25)), > > > name = Column(String(50)), > > > passwd = Column(String(100)), > > > email = Column(String(100)), > > > atype = Column(String(50)), > > > active = Column(Boolean), > > > customers_id = Column('customers_id', Integer, > > > ForeignKey('customers.id')), > > > all of those commas at the end of each line results in the class having a > > tuple called "id" in it, rather than a set of attributes "id", "login", > > "name" etc which declarative can interpret as mapping directives. -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.