Skip to content

Commit

Permalink
Removed some debug print statements.
Browse files Browse the repository at this point in the history
git-svn-id: http://tranquil.googlecode.com/svn/trunk@4 66ac46bf-b33b-0410-90a4-43c7d5e8004f
  • Loading branch information
davisp committed Oct 5, 2007
1 parent 311cc81 commit f157b76
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 8 deletions.
5 changes: 0 additions & 5 deletions Tranquil/tranquil/models.py
Expand Up @@ -34,20 +34,16 @@ def find_module(self,fullname,path=None):
return None

def load_module(self,fullname):
print 'MODULE: %s' % fullname
if self.tables is None:
( self.tables, self.objects ) = translate( self.meta, self.cache )
if sys.modules.get( fullname ):
return sys.modules[fullname]
print 'LOADING: %s' % fullname
mod = sys.modules[fullname] = new.module(fullname)
mod.__file__ = 'tranquil: %s' % fullname
mod.__loader__ = self
app = fullname.replace( 'tranquil.models.', '' )
print self.objects.get( app, 'Not here!' )
if self.objects.get( app ) is not None:
for obj in self.objects[app]:
print 'APP: %s TYPE: %s' % ( app, obj.__name__ )
setattr( mod, obj.__name__, obj )
return mod

Expand All @@ -56,6 +52,5 @@ def cache_model(self,sender=None):
if app not in self.apps:
self.apps.add( app )
table = sender._meta.db_table
print 'APP: %s TABLE: %s' % ( app, table )
self.cache[table] = sender

3 changes: 0 additions & 3 deletions Tranquil/tranquil/translator.py
Expand Up @@ -11,16 +11,13 @@ def stringify(table):
return ret

def translate( meta, models ):
print models
sa_tables = {}
sa_objects = {}
for tbl in meta.table_iterator():
if str( tbl ) in models:
print 'HAS MODEL: %s' % tbl
app = models[str(tbl)]._meta.app_label
obj = models[str(tbl)]._meta.object_name
else:
print 'DYNAMIC: %s' % tbl
app = getattr( settings, 'NO_MODEL_MODULE', 'dyn' )
obj = stringify( str( tbl ) )
if sa_objects.get( app ) is None:
Expand Down

0 comments on commit f157b76

Please sign in to comment.