diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2006-03-26 15:36:43 +0000 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2006-03-26 15:36:43 +0000 |
| commit | 46eb453c36e742ec69fbc0442ac43245d7ee7eb7 (patch) | |
| tree | ca1cd1c1ea51a6b1d95f63938860c1720baed727 /lib/sqlalchemy | |
| parent | fcace31b887d0edb73dfd01a9134727d3647061f (diff) | |
| download | sqlalchemy-46eb453c36e742ec69fbc0442ac43245d7ee7eb7.tar.gz | |
column label generation checks for a conflict against a column named the same as the label
comment in mapper
Diffstat (limited to 'lib/sqlalchemy')
| -rw-r--r-- | lib/sqlalchemy/mapping/mapper.py | 4 | ||||
| -rw-r--r-- | lib/sqlalchemy/sql.py | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/sqlalchemy/mapping/mapper.py b/lib/sqlalchemy/mapping/mapper.py index 82257ae62..1efdb649a 100644 --- a/lib/sqlalchemy/mapping/mapper.py +++ b/lib/sqlalchemy/mapping/mapper.py @@ -998,8 +998,8 @@ class MapperExtension(object): Essentially, this method is used to have a different mapper populate the object: - def populate_instance(self, mapper, *args): - othermapper.populate_instance(*args) + def populate_instance(self, mapper, instance, row, identitykey, imap, isnew): + othermapper.populate_instance(instance, row, identitykey, imap, isnew, frommapper=mapper) return False """ if self.next is None: diff --git a/lib/sqlalchemy/sql.py b/lib/sqlalchemy/sql.py index c4cb4d148..6116a44e1 100644 --- a/lib/sqlalchemy/sql.py +++ b/lib/sqlalchemy/sql.py @@ -1024,7 +1024,7 @@ class ColumnClause(ColumnElement): self.__label = self.table.name + "_" + self.text else: self.__label = self.text - if len(self.__label) >= 30: + if (self.table is not None and self.table.c.has_key(self.__label)) or len(self.__label) >= 30: self.__label = self.__label[0:24] + "_" + hex(random.randint(0, 65535))[2:] return self.__label _label = property(_get_label) |
