File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,10 @@ def getModel(metadata):
4747 model = Model()
4848"""
4949
50+ PG_IMPORT = """\
51+ from sqlalchemy.databases.postgres import *
52+ """
53+
5054FOOTER_Z3C = """
5155 return model
5256"""
@@ -102,6 +106,7 @@ def getModel(metadata):
102106try:
103107 from IPython.Shell import IPShellEmbed
104108 print 'Success! Type <ctrl-d> to exit.'
109+ print 'Available models:%%s'%%%s
105110 ipshell = IPShellEmbed()
106111 ipshell()
107112except:
Original file line number Diff line number Diff line change @@ -113,6 +113,8 @@ def __repr__(self):
113113 if not isinstance (engine , basestring ):
114114 engine = str (engine .url )
115115 s .write (constants .HEADER_DECL % engine )
116+ if 'postgres' in engine :
117+ s .write (constants .PG_IMPORT )
116118 for table in tables :
117119 s .write ('%s = %s\n \n ' % (table .name , self ._table_repr (table )))
118120
@@ -123,7 +125,7 @@ def __repr__(self):
123125 if self .config .example or self .config .interactive :
124126 s .write (constants .EXAMPLE_DECL % models [0 ].__name__ )
125127 if self .config .interactive :
126- s .write (constants .INTERACTIVE )
128+ s .write (constants .INTERACTIVE % [ model . __name__ for model in models ] )
127129 return s .getvalue ()
128130
129131 @property
You can’t perform that action at this time.
0 commit comments