This seems (to me) like an obvious question but a brief googling and looking at
the docs didn't seem to find the answer.
I have an existing database (lets say mysql)
I can easily create object like:
class BroadPeaks(Base):
__table__ = Table('broad_peaks', Base.metadata, autoload=True)
def __repr__(self):
return '<Peak %r>' % (self.peak_name)
Once I am connected, yay. And I think this has already all the relationships I
need.
But let's say I am SOOOO lazy that I just want to auto generate the lines:
class ClassName(Base)
__table__ = Table('table_name', Base.metadata, autoload=True)
For each table. Should I just introspect the metadata object? I thought of
this but not all the tables were loaded...
Ben
--
Ben Hitz
Senior Scientific Programmer ** Saccharomyces Genome Database ** GO Consortium
Stanford University ** [email protected]
--
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.