Author: carndt
Date: Sun Sep 20 08:37:09 2009
New Revision: 6667
URL: http://trac.turbogears.org/changeset/6667

Log:
Remove obsolete code from catwalk. Fixes #2162

Modified:
   branches/1.0/turbogears/toolbox/catwalk/__init__.py
   branches/1.1/turbogears/toolbox/catwalk/__init__.py
   branches/1.5/turbogears/toolbox/catwalk/__init__.py

Modified: branches/1.0/turbogears/toolbox/catwalk/__init__.py
==============================================================================
--- branches/1.0/turbogears/toolbox/catwalk/__init__.py (original)
+++ branches/1.0/turbogears/toolbox/catwalk/__init__.py Sun Sep 20 08:37:09 2009
@@ -250,21 +250,9 @@
         parameters = self.extract_parameters(columns, values)
         instance.set(**parameters)
 
-    def remove_related_joins_if_any(self, object_name, id):
-        """Remove any related joins the object may have."""
-        obj = self.load_object(object_name)
-        instance = self.load_instance(object_name, id)
-        for join in obj.sqlmeta.joins:
-            if self.get_column_type(join) != 'SORelatedJoin':
-                continue
-            for join_reference in list(getattr(instance, join.joinMethodName)):
-                method = 'remove' + join.otherClassName
-                getattr(instance, method)(join_reference)
-
     def remove_object(self, object_name, id):
         """Remove the object by id."""
         obj = self.load_object(object_name)
-        self.remove_related_joins_if_any(object_name, id)
         try:
             obj.delete(id)
         except:

Modified: branches/1.1/turbogears/toolbox/catwalk/__init__.py
==============================================================================
--- branches/1.1/turbogears/toolbox/catwalk/__init__.py (original)
+++ branches/1.1/turbogears/toolbox/catwalk/__init__.py Sun Sep 20 08:37:09 2009
@@ -250,21 +250,9 @@
         parameters = self.extract_parameters(columns, values)
         instance.set(**parameters)
 
-    def remove_related_joins_if_any(self, object_name, id):
-        """Remove any related joins the object may have."""
-        obj = self.load_object(object_name)
-        instance = self.load_instance(object_name, id)
-        for join in obj.sqlmeta.joins:
-            if self.get_column_type(join) != 'SORelatedJoin':
-                continue
-            for join_reference in list(getattr(instance, join.joinMethodName)):
-                method = 'remove' + join.otherClassName
-                getattr(instance, method)(join_reference)
-
     def remove_object(self, object_name, id):
         """Remove the object by id."""
         obj = self.load_object(object_name)
-        self.remove_related_joins_if_any(object_name, id)
         try:
             obj.delete(id)
         except:

Modified: branches/1.5/turbogears/toolbox/catwalk/__init__.py
==============================================================================
--- branches/1.5/turbogears/toolbox/catwalk/__init__.py (original)
+++ branches/1.5/turbogears/toolbox/catwalk/__init__.py Sun Sep 20 08:37:09 2009
@@ -249,21 +249,9 @@
         parameters = self.extract_parameters(columns, values)
         instance.set(**parameters)
 
-    def remove_related_joins_if_any(self, object_name, id):
-        """Remove any related joins the object may have."""
-        obj = self.load_object(object_name)
-        instance = self.load_instance(object_name, id)
-        for join in obj.sqlmeta.joins:
-            if self.get_column_type(join) != 'SORelatedJoin':
-                continue
-            for join_reference in list(getattr(instance, join.joinMethodName)):
-                method = 'remove' + join.otherClassName
-                getattr(instance, method)(join_reference)
-
     def remove_object(self, object_name, id):
         """Remove the object by id."""
         obj = self.load_object(object_name)
-        self.remove_related_joins_if_any(object_name, id)
         try:
             obj.delete(id)
         except:

Reply via email to