]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- removed needless "counter" behavior with select()
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 8 Dec 2009 02:31:59 +0000 (02:31 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 8 Dec 2009 02:31:59 +0000 (02:31 +0000)
labelnames that match a column name in the table,
i.e. generates "tablename_id" for "id", instead of
"tablename_id_1" in an attempt to avoid naming
conflicts, when the table has a column actually
named "tablename_id" - this is because
the labeling logic is always applied to all columns
      so a naming conflict will never occur.

CHANGES
lib/sqlalchemy/sql/expression.py

diff --git a/CHANGES b/CHANGES
index 0cfc4f463146c74e59749ef058438e5b3c757400..87f484f69cbd16a2a2a14d75fbdc334511df1191 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -241,6 +241,15 @@ CHANGES
       with underscores for dots, i.e. "dbo_master_table_column".
       This is a "friendly" label that behaves better
       in result sets. [ticket:1428]
+    
+    - removed needless "counter" behavior with select()
+      labelnames that match a column name in the table,
+      i.e. generates "tablename_id" for "id", instead of
+      "tablename_id_1" in an attempt to avoid naming 
+      conflicts, when the table has a column actually 
+      named "tablename_id" - this is because
+      the labeling logic is always applied to all columns
+      so a naming conflict will never occur.
       
     - Deprecated or removed:
         * "scalar" flag on select() is removed, use 
index 1b9f89ae138256a50b5d5cfcfbd368104e121ea8..b7708c338d95b725eb91e1f8f4e302a0910dc7ee 100644 (file)
@@ -3022,14 +3022,6 @@ class ColumnClause(_Immutable, ColumnElement):
                 label = _escape_for_generated(self.table.name) + "_" + \
                             _escape_for_generated(self.name)
 
-            if label in self.table.c:
-                # TODO: coverage does not seem to be present for this
-                _label = label
-                counter = 1
-                while _label in self.table.c:
-                    _label = label + "_" + str(counter)
-                    counter += 1
-                label = _label
             return _generated_label(label)
 
         else: