Patches item #1416838, was opened at 2006-01-27 22:52
Message generated for change (Settings changed) made by phd
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1416838&group_id=74338
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
>Status: Closed
Resolution: Rejected
Priority: 5
Submitted By: Gabriel Reid (gab_reid)
Assigned to: Nobody/Anonymous (nobody)
Summary: Fix for styles.py for uppercase column names
Initial Comment:
If a database column name is in all uppercase, with
words separated by undscores (as is the case with
column names when fetched from the data dictionary in
Firebird), the conversion from database column name to
Python attribute name and back does not work correctly,
as shown below. This is due to the fact that the style
expects a lowercase column name, which will not be the
case with Firebird connections.
Example:
>>>
>>> from sqlobject import styles
>>> style = styles.DefaultStyle()
>>>
style.pythonAttrToDBColumn(style.dbColumnToPythonAttr('START_DATE'))
'startdat_e'
>>>
style.pythonAttrToDBColumn(style.dbColumnToPythonAttr('start_date'))
'start_date'
The attached patch simply converts the column name to
lowercase before performing the conversion on it in
underToMixed.
----------------------------------------------------------------------
Comment By: Oleg Broytmann (phd)
Date: 2006-01-31 19:14
Message:
Logged In: YES
user_id=4799
The patch is too simple, it breaks many things. For example,
test_SQLMultipleJoin.py:
return self.FieldClass(self.tableName,
E
self.soClass.sqlmeta.columns[attr].dbName,
> KeyError: 'raceid'
[sqlobject/sqlbuilder.py:365]
test_SingleJoin.py:
return self.FieldClass(self.tableName,
E
self.soClass.sqlmeta.columns[attr].dbName,
> KeyError: 'personid'
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1416838&group_id=74338
|