Hi Michael,
I see that sql.py uses a limit of 30 characters to create the column
label when "use_labels" is set to True.
If name is greater than 30 char long, the label is trunked at position
24 and is appended a random integer to it.
Since the name created in this way is less useful, I would like to
sugest you to customize the maxlength of column names.
(PostgreSQL accepts until 63 characters for names, with SQLite you may
use very, very long names....)
def _get_label(self):
if self.__label is None:
if self.table is not None and self.table.named_with_column():
self.__label = self.table.name + "_" + self.name
#if self.table.c.has_key(self.__label) or
len(self.__label) >= 30:
if self.table.c.has_key(self.__label) or
len(self.__label) >= MAX_LABEL_LENGTH:
self.__label = self.__label[0:24] + "_" +
hex(random.randint(0, 65535))[2:]
else:
self.__label = self.name
self.__label = "".join([x for x in self.__label if x in
legal_characters])
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---