On Aug 12, 3:13 pm, "[email protected]" <[email protected]>
wrote:
> Here is my model ...
> class Address(DeclarativeBase):
> __tablename__ = 'addresses'
> id = Column(Integer, primary_key=True)
> email_address = Column(String)
> people_id = Column(Integer, ForeignKey('users.id'))
> person = relation(Users, backref=backref('addresses',
> order_by=id))
> def __init__(self, email_address):
> self.email_address = email_address
> def __repr__(self):
> return "<Address('%s')>" % self.email_address
>
> when i run paster setup-app development.ini i get ...
> raise exc.DBAPIError.instance(statement, parameters, e,
> connection_invalidated=is_disconnect)
> sqlalchemy.exc.ProgrammingError: (ProgrammingError) (1064, "You have
> an error in your SQL syntax; check the manual that corresponds to your
> MySQL server version for the right syntax to use near ' \n\tpeople_id
> INTEGER, \n\tPRIMARY KEY (id), \n\t FOREIGN KEY(people_id) REFERENCES
> u' at line 3") '\nCREATE TABLE addresses (\n\tid INTEGER NOT NULL
> AUTO_INCREMENT, \n\temail_address VARCHAR, \n\tpeople_id INTEGER, \n
> \tPRIMARY KEY (id), \n\t FOREIGN KEY(people_id) REFERENCES users (id)
> \n)\n\n' ()
In looking at this a little closer, it appears to be failing on
email_address = Column(String)
Try changing that to
email_address = Column(Unicode(80))
to see if it works.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---