sqlobject-cvs Mailing List for SQLObject (Page 65)
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
(9) |
Apr
(74) |
May
(29) |
Jun
(16) |
Jul
(28) |
Aug
(10) |
Sep
(57) |
Oct
(9) |
Nov
(29) |
Dec
(12) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(7) |
Feb
(14) |
Mar
(6) |
Apr
(3) |
May
(12) |
Jun
(34) |
Jul
(9) |
Aug
(29) |
Sep
(22) |
Oct
(2) |
Nov
(15) |
Dec
(52) |
| 2005 |
Jan
(47) |
Feb
(78) |
Mar
(14) |
Apr
(35) |
May
(33) |
Jun
(16) |
Jul
(26) |
Aug
(63) |
Sep
(40) |
Oct
(96) |
Nov
(96) |
Dec
(123) |
| 2006 |
Jan
(159) |
Feb
(144) |
Mar
(64) |
Apr
(31) |
May
(88) |
Jun
(48) |
Jul
(16) |
Aug
(64) |
Sep
(87) |
Oct
(92) |
Nov
(56) |
Dec
(76) |
| 2007 |
Jan
(94) |
Feb
(103) |
Mar
(126) |
Apr
(123) |
May
(85) |
Jun
(11) |
Jul
(130) |
Aug
(47) |
Sep
(65) |
Oct
(70) |
Nov
(12) |
Dec
(11) |
| 2008 |
Jan
(30) |
Feb
(55) |
Mar
(88) |
Apr
(20) |
May
(50) |
Jun
|
Jul
(38) |
Aug
(1) |
Sep
(9) |
Oct
(5) |
Nov
(6) |
Dec
(39) |
| 2009 |
Jan
(8) |
Feb
(16) |
Mar
(3) |
Apr
(33) |
May
(44) |
Jun
(1) |
Jul
(10) |
Aug
(33) |
Sep
(74) |
Oct
(22) |
Nov
|
Dec
(15) |
| 2010 |
Jan
(28) |
Feb
(22) |
Mar
(46) |
Apr
(29) |
May
(1) |
Jun
(1) |
Jul
(27) |
Aug
(8) |
Sep
(5) |
Oct
(33) |
Nov
(24) |
Dec
(41) |
| 2011 |
Jan
(4) |
Feb
(12) |
Mar
(35) |
Apr
(29) |
May
(19) |
Jun
(16) |
Jul
(32) |
Aug
(25) |
Sep
(5) |
Oct
(11) |
Nov
(21) |
Dec
(12) |
| 2012 |
Jan
(3) |
Feb
(4) |
Mar
(20) |
Apr
(4) |
May
(25) |
Jun
(13) |
Jul
|
Aug
|
Sep
(2) |
Oct
(25) |
Nov
(9) |
Dec
(1) |
| 2013 |
Jan
(6) |
Feb
(8) |
Mar
|
Apr
(10) |
May
(31) |
Jun
(7) |
Jul
(18) |
Aug
(33) |
Sep
(4) |
Oct
(16) |
Nov
|
Dec
(27) |
| 2014 |
Jan
(2) |
Feb
|
Mar
|
Apr
(11) |
May
(39) |
Jun
(8) |
Jul
(11) |
Aug
(4) |
Sep
|
Oct
(27) |
Nov
|
Dec
(71) |
| 2015 |
Jan
(17) |
Feb
(47) |
Mar
(33) |
Apr
|
May
|
Jun
(9) |
Jul
(7) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(8) |
| 2016 |
Jan
(4) |
Feb
(4) |
Mar
|
Apr
|
May
(12) |
Jun
(7) |
Jul
(9) |
Aug
(31) |
Sep
(8) |
Oct
(3) |
Nov
(15) |
Dec
(1) |
| 2017 |
Jan
(13) |
Feb
(7) |
Mar
(14) |
Apr
(8) |
May
(10) |
Jun
(4) |
Jul
(2) |
Aug
(1) |
Sep
|
Oct
(8) |
Nov
(4) |
Dec
(5) |
| 2018 |
Jan
(2) |
Feb
(8) |
Mar
|
Apr
(4) |
May
|
Jun
(6) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2019 |
Jan
(1) |
Feb
(16) |
Mar
(1) |
Apr
(3) |
May
(5) |
Jun
(1) |
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
(1) |
Dec
(3) |
| 2020 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(1) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
(2) |
Nov
|
Dec
(2) |
| 2021 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(1) |
Dec
|
| 2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(6) |
Oct
(1) |
Nov
(1) |
Dec
(4) |
| 2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(3) |
Sep
(2) |
Oct
(2) |
Nov
(4) |
Dec
|
| 2024 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(9) |
| 2025 |
Jan
|
Feb
(4) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
(2) |
Dec
(2) |
|
From: SourceForge.net <no...@so...> - 2008-07-24 16:09:46
|
Bugs item #2009801, was opened at 2008-07-03 19:16 Message generated for change (Comment added) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=2009801&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: SQLite Group: SQLObject release (specify) >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) >Assigned to: Oleg Broytmann (phd) Summary: sqlobject-admin fails to process sqlite database with enums Initial Comment: Seen in both 10.1 and 10.2, installed via setuptools. The problem occurs when running a command such as... ====== sqlobject-admin record --output-dir=sqlobject-history ====== ... using a sqlite database that has enum types. The symptoms are that an infinite loop is reached and executes until an out of memory exception occurs: ====== Creating version 2008-07-03 Making directory sqlobject-history/2008-07-03 Python(3304,0xa0237fa0) malloc: *** mmap(size=1140854784) failed (error code=12) *** error: can't allocate region *** set a breakpoint in malloc_error_break to debug Traceback (most recent call last): File "/usr/local/bin/sqlobject-admin", line 5, in <module> pkg_resources.run_script('SQLObject==0.10.2', 'sqlobject-admin') File "/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/pkg_resources.py", line 442, in run_script self.require(requires)[0].run_script(script_name, ns) File "/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/pkg_resources.py", line 1160, in run_script execfile(script_filename, namespace, namespace) File "/Library/Python/2.5/site-packages/SQLObject-0.10.2-py2.5.egg/EGG-INFO/scripts/sqlobject-admin", line 35, in <module> command.the_runner.run(sys.argv) File "/Library/Python/2.5/site-packages/SQLObject-0.10.2-py2.5.egg/sqlobject/manager/command.py", line 101, in run runner.run() File "/Library/Python/2.5/site-packages/SQLObject-0.10.2-py2.5.egg/sqlobject/manager/command.py", line 307, in run self.command() File "/Library/Python/2.5/site-packages/SQLObject-0.10.2-py2.5.egg/sqlobject/manager/command.py", line 1015, in command diffs = db_differences(cls, conn) File "/Library/Python/2.5/site-packages/SQLObject-0.10.2-py2.5.egg/sqlobject/manager/command.py", line 55, in db_differences soClass) File "/Library/Python/2.5/site-packages/SQLObject-0.10.2-py2.5.egg/sqlobject/sqlite/sqliteconnection.py", line 286, in columnsFromSchema return self._columnsFromSchemaParse(tableName, soClass) File "/Library/Python/2.5/site-packages/SQLObject-0.10.2-py2.5.egg/sqlobject/sqlite/sqliteconnection.py", line 313, in _columnsFromSchemaParse colData = colData[:st] + colData[en+1:] MemoryError ====== The problem is specifically in sqliteconnection.py, on or around line 313 with the following loop: ====== while colData.find('(') > -1: st = colData.find('(') en = colData.find(')') colData = colData[:st] + colData[en+1:] ====== When this code processes colData with the following value: ====== CREATE TABLE test_table ( id INTEGER PRIMARY KEY, test_enum VARCHAR (9) CHECK (test_enum in ('available', 'reserved', 'used')), test_string VARCHAR (64) UNIQUE ) ====== After an iteration or so, colData will have the following value (still valid): ====== id INTEGER PRIMARY KEY, test_enum VARCHAR CHECK (test_enum in ('available', 'reserved', 'used')), test_string VARCHAR (64) UNIQUE ====== Now comes the problem. During this iteration, st will get the index of the first open paren on the enum line, and en will get the index of the first close paren on the enum line. This is incorrect. The correct behavior is for en to get the index of the second close paren on the enum line. This incorrect behavior results in the following new value for colData: ====== id INTEGER PRIMARY KEY, test_enum VARCHAR CHECK ), test_string VARCHAR (64) UNIQUE ====== en from this point on continuously gets the index of that close paren left behind on the enum line, while st gets the index of the open paren on the following line... blowing up the file. At a minimum, doing en = colData.find(')', st) will prevent it from blowing up, although this isn't technically correct behavior, since it will still leave behind that close paren. ---------------------------------------------------------------------- >Comment By: Oleg Broytmann (phd) Date: 2008-07-24 20:09 Message: Logged In: YES user_id=4799 Originator: NO Fixed in the revisions 3525-3528 (branches 0.9, 0.10 and the trunk). Thank you! ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=2009801&group_id=74338 |
|
From: <sub...@co...> - 2008-07-24 16:09:19
|
Author: phd
Date: 2008-07-24 10:09:16 -0600 (Thu, 24 Jul 2008)
New Revision: 3528
Modified:
SQLObject/trunk/docs/News.txt
SQLObject/trunk/sqlobject/sqlite/sqliteconnection.py
Log:
Fixed the bug 2009801: sqlobject-admin fails to process sqlite database with enums.
Modified: SQLObject/trunk/docs/News.txt
===================================================================
--- SQLObject/trunk/docs/News.txt 2008-07-24 16:08:28 UTC (rev 3527)
+++ SQLObject/trunk/docs/News.txt 2008-07-24 16:09:16 UTC (rev 3528)
@@ -142,6 +142,8 @@
* Added test_default_style.py.
+* Fixed a minor bug in SQLiteConnection that fails to parse Enum columns.
+
SQLObject 0.9.7
===============
Modified: SQLObject/trunk/sqlobject/sqlite/sqliteconnection.py
===================================================================
--- SQLObject/trunk/sqlobject/sqlite/sqliteconnection.py 2008-07-24 16:08:28 UTC (rev 3527)
+++ SQLObject/trunk/sqlobject/sqlite/sqliteconnection.py 2008-07-24 16:09:16 UTC (rev 3528)
@@ -309,9 +309,9 @@
raise ValueError('The table %s ws not found in the database. Load failed.' % tableName)
colData = colData[0].split('(', 1)[1].strip()[:-2]
while colData.find('(') > -1:
- st = colData.find('(')
- en = colData.find(')')
- colData = colData[:st] + colData[en+1:]
+ start = colData.find('(')
+ end = colData.find(')', start)
+ colData = colData[:start] + colData[end+1:]
results = []
for colDesc in colData.split(','):
parts = colDesc.strip().split(' ', 2)
|
|
From: <sub...@co...> - 2008-07-24 16:08:30
|
Author: phd
Date: 2008-07-24 10:08:28 -0600 (Thu, 24 Jul 2008)
New Revision: 3527
Modified:
SQLObject/branches/0.10/docs/News.txt
SQLObject/branches/0.10/sqlobject/sqlite/sqliteconnection.py
Log:
Fixed the bug 2009801: sqlobject-admin fails to process sqlite database with enums.
Modified: SQLObject/branches/0.10/docs/News.txt
===================================================================
--- SQLObject/branches/0.10/docs/News.txt 2008-07-24 16:07:16 UTC (rev 3526)
+++ SQLObject/branches/0.10/docs/News.txt 2008-07-24 16:08:28 UTC (rev 3527)
@@ -106,6 +106,8 @@
* Added test_default_style.py.
+* Fixed a minor bug in SQLiteConnection that fails to parse Enum columns.
+
SQLObject 0.9.7
===============
Modified: SQLObject/branches/0.10/sqlobject/sqlite/sqliteconnection.py
===================================================================
--- SQLObject/branches/0.10/sqlobject/sqlite/sqliteconnection.py 2008-07-24 16:07:16 UTC (rev 3526)
+++ SQLObject/branches/0.10/sqlobject/sqlite/sqliteconnection.py 2008-07-24 16:08:28 UTC (rev 3527)
@@ -308,9 +308,9 @@
raise ValueError('The table %s ws not found in the database. Load failed.' % tableName)
colData = colData[0].split('(', 1)[1].strip()[:-2]
while colData.find('(') > -1:
- st = colData.find('(')
- en = colData.find(')')
- colData = colData[:st] + colData[en+1:]
+ start = colData.find('(')
+ end = colData.find(')', start)
+ colData = colData[:start] + colData[end+1:]
results = []
for colDesc in colData.split(','):
parts = colDesc.strip().split(' ', 2)
|
|
From: <sub...@co...> - 2008-07-24 16:07:18
|
Author: phd Date: 2008-07-24 10:07:16 -0600 (Thu, 24 Jul 2008) New Revision: 3526 Modified: SQLObject/branches/0.9/docs/News.txt Log: Doc update. Modified: SQLObject/branches/0.9/docs/News.txt =================================================================== --- SQLObject/branches/0.9/docs/News.txt 2008-07-24 16:04:25 UTC (rev 3525) +++ SQLObject/branches/0.9/docs/News.txt 2008-07-24 16:07:16 UTC (rev 3526) @@ -15,6 +15,8 @@ * Added test_default_style.py. +* Fixed a minor bug in SQLiteConnection that fails to parse Enum columns. + SQLObject 0.9.7 =============== |
|
From: <sub...@co...> - 2008-07-24 16:04:34
|
Author: phd
Date: 2008-07-24 10:04:25 -0600 (Thu, 24 Jul 2008)
New Revision: 3525
Modified:
SQLObject/branches/0.9/sqlobject/sqlite/sqliteconnection.py
Log:
Fixed the bug 2009801: sqlobject-admin fails to process sqlite database with enums.
Modified: SQLObject/branches/0.9/sqlobject/sqlite/sqliteconnection.py
===================================================================
--- SQLObject/branches/0.9/sqlobject/sqlite/sqliteconnection.py 2008-07-23 15:41:06 UTC (rev 3524)
+++ SQLObject/branches/0.9/sqlobject/sqlite/sqliteconnection.py 2008-07-24 16:04:25 UTC (rev 3525)
@@ -308,9 +308,9 @@
raise ValueError('The table %s ws not found in the database. Load failed.' % tableName)
colData = colData[0].split('(', 1)[1].strip()[:-2]
while colData.find('(') > -1:
- st = colData.find('(')
- en = colData.find(')')
- colData = colData[:st] + colData[en+1:]
+ start = colData.find('(')
+ end = colData.find(')', start)
+ colData = colData[:start] + colData[end+1:]
results = []
for colDesc in colData.split(','):
parts = colDesc.strip().split(' ', 2)
|
|
From: SourceForge.net <no...@so...> - 2008-07-24 15:56:13
|
Bugs item #2026909, was opened at 2008-07-24 19:43 Message generated for change (Comment added) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=2026909&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: Invalid Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: name column should be available Initial Comment: Hello, I want to migrate from sqlalchemy to sqlobject but it doesn't allow to me to use "name" columns. My application makes widely use of this naming, how can I bypass this restriction? ---------------------------------------------------------------------- >Comment By: Oleg Broytmann (phd) Date: 2008-07-24 19:56 Message: Logged In: YES user_id=4799 Originator: NO Welcome and good luck! (-: ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2008-07-24 19:45 Message: Logged In: NO I'm sorry, it was my mistake, you can close the bug as worksforme. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=2026909&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2008-07-24 15:45:55
|
Bugs item #2026909, was opened at 2008-07-24 15:43 Message generated for change (Comment added) made by nobody You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=2026909&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: Open Resolution: None Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: name column should be available Initial Comment: Hello, I want to migrate from sqlalchemy to sqlobject but it doesn't allow to me to use "name" columns. My application makes widely use of this naming, how can I bypass this restriction? ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2008-07-24 15:45 Message: Logged In: NO I'm sorry, it was my mistake, you can close the bug as worksforme. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=2026909&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2008-07-24 15:43:46
|
Bugs item #2026909, was opened at 2008-07-24 15:43 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=2026909&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: Open Resolution: None Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: name column should be available Initial Comment: Hello, I want to migrate from sqlalchemy to sqlobject but it doesn't allow to me to use "name" columns. My application makes widely use of this naming, how can I bypass this restriction? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=2026909&group_id=74338 |
|
From: <sub...@co...> - 2008-07-23 15:42:37
|
Author: phd
Date: 2008-07-23 09:41:06 -0600 (Wed, 23 Jul 2008)
New Revision: 3524
Modified:
SQLObject/trunk/sqlobject/tests/test_schema.py
Log:
Allow the test to be run without 'schema=' parameter in the DB URI.
Modified: SQLObject/trunk/sqlobject/tests/test_schema.py
===================================================================
--- SQLObject/trunk/sqlobject/tests/test_schema.py 2008-07-23 14:22:44 UTC (rev 3523)
+++ SQLObject/trunk/sqlobject/tests/test_schema.py 2008-07-23 15:41:06 UTC (rev 3524)
@@ -11,12 +11,11 @@
def test_connection_schema():
if not supports('schema'):
return
- conn = getConnection(schema=None)
+ conn = getConnection()
conn.schema = None
conn.query('CREATE SCHEMA test')
+ conn.schema = 'test'
+ conn.query('SET search_path TO test')
setupClass(Test)
Test(foo='bar')
- conn = Test._connection
- assert conn.schema, \
- """To test a schema you need to give a connection uri that contains a schema."""
- assert conn.queryAll("select * from %s.test" % conn.schema)
+ assert conn.queryAll("SELECT * FROM test.test")
|
|
From: <sub...@co...> - 2008-07-23 14:22:46
|
Author: phd Date: 2008-07-23 08:22:44 -0600 (Wed, 23 Jul 2008) New Revision: 3523 Modified: SQLObject/trunk/docs/News.txt Log: Added some support for schemas in PostgreSQL. Modified: SQLObject/trunk/docs/News.txt =================================================================== --- SQLObject/trunk/docs/News.txt 2008-07-23 14:20:47 UTC (rev 3522) +++ SQLObject/trunk/docs/News.txt 2008-07-23 14:22:44 UTC (rev 3523) @@ -25,6 +25,8 @@ * SQLObject can now create and drop a database in MySQL, PostgreSQL, SQLite and Firebird/Interbase. +* Added some support for schemas in PostgreSQL. + Minor features -------------- |
|
From: <sub...@co...> - 2008-07-23 14:20:49
|
Author: phd
Date: 2008-07-23 08:20:47 -0600 (Wed, 23 Jul 2008)
New Revision: 3522
Added:
SQLObject/trunk/sqlobject/tests/test_schema.py
Modified:
SQLObject/trunk/docs/SQLObject.txt
SQLObject/trunk/sqlobject/postgres/pgconnection.py
SQLObject/trunk/sqlobject/tests/dbtest.py
Log:
A patch by Diez B. Roggisch: added support for schemas in PostgreSQL.
Modified: SQLObject/trunk/docs/SQLObject.txt
===================================================================
--- SQLObject/trunk/docs/SQLObject.txt 2008-07-23 13:58:11 UTC (rev 3521)
+++ SQLObject/trunk/docs/SQLObject.txt 2008-07-23 14:20:47 UTC (rev 3522)
@@ -162,7 +162,8 @@
Parameters are: ``debug`` (default: False), ``debugOutput`` (default: False),
``cache`` (default: True), ``autoCommit`` (default: True),
``debugThreading`` (default: False),
-``logger`` (default: None), ``loglevel`` (default: None).
+``logger`` (default: None), ``loglevel`` (default: None),
+``schema`` (default: None).
If you want to pass True value in a connection URI - pass any non-empty
string; an empty string for False.
Modified: SQLObject/trunk/sqlobject/postgres/pgconnection.py
===================================================================
--- SQLObject/trunk/sqlobject/postgres/pgconnection.py 2008-07-23 13:58:11 UTC (rev 3521)
+++ SQLObject/trunk/sqlobject/postgres/pgconnection.py 2008-07-23 14:20:47 UTC (rev 3522)
@@ -85,6 +85,7 @@
dsn = ' '.join(dsn)
self.dsn = dsn
self.unicodeCols = unicodeCols
+ self.schema = kw.pop('schema', None)
DBAPI.__init__(self, **kw)
def connectionFromURI(cls, uri):
@@ -114,6 +115,9 @@
# psycopg2 does not have an autocommit method.
if hasattr(conn, 'autocommit'):
conn.autocommit(1)
+ if self.schema:
+ c = conn.cursor()
+ c.execute("SET search_path TO " + self.schema)
return conn
def _queryInsertID(self, conn, soInstance, id, names, values):
Modified: SQLObject/trunk/sqlobject/tests/dbtest.py
===================================================================
--- SQLObject/trunk/sqlobject/tests/dbtest.py 2008-07-23 13:58:11 UTC (rev 3521)
+++ SQLObject/trunk/sqlobject/tests/dbtest.py 2008-07-23 14:20:47 UTC (rev 3522)
@@ -45,7 +45,8 @@
'-blobData': 'mssql',
'-decimalColumn': 'mssql',
'-emptyTable': 'mssql',
- '-limitSelect' : 'mssql'
+ '-limitSelect' : 'mssql',
+ '+schema' : 'postgres',
}
Added: SQLObject/trunk/sqlobject/tests/test_schema.py
===================================================================
--- SQLObject/trunk/sqlobject/tests/test_schema.py (rev 0)
+++ SQLObject/trunk/sqlobject/tests/test_schema.py 2008-07-23 14:20:47 UTC (rev 3522)
@@ -0,0 +1,22 @@
+from sqlobject import *
+from sqlobject.tests.dbtest import *
+
+########################################
+## Schema per connection
+########################################
+
+class Test(SQLObject):
+ foo = UnicodeCol(length=200)
+
+def test_connection_schema():
+ if not supports('schema'):
+ return
+ conn = getConnection(schema=None)
+ conn.schema = None
+ conn.query('CREATE SCHEMA test')
+ setupClass(Test)
+ Test(foo='bar')
+ conn = Test._connection
+ assert conn.schema, \
+ """To test a schema you need to give a connection uri that contains a schema."""
+ assert conn.queryAll("select * from %s.test" % conn.schema)
|
|
From: <sub...@co...> - 2008-07-23 13:58:14
|
Author: phd Date: 2008-07-23 07:58:11 -0600 (Wed, 23 Jul 2008) New Revision: 3521 Modified: SQLObject/trunk/docs/DeveloperGuide.txt Log: Minor documentation update - fixed devguide on how to pass DB URI to tests. Modified: SQLObject/trunk/docs/DeveloperGuide.txt =================================================================== --- SQLObject/trunk/docs/DeveloperGuide.txt 2008-07-23 13:57:48 UTC (rev 3520) +++ SQLObject/trunk/docs/DeveloperGuide.txt 2008-07-23 13:58:11 UTC (rev 3521) @@ -152,11 +152,9 @@ .. _getting started: http://codespeak.net/py/dist/test.html#starting-point-py-test-command-line-tool To actually run the test, you have to give it a database to connect -to. You do this with the ``TESTDB`` environmental variable (right now -py.test doesn't have a better way to add custom options). You can -give the complete URI to access your test database, or you can give it -a shortcut like ``mysql`` (these shortcuts are defined in the top of -``tests/dbtest.py``. +to. You do so with the option "-D". You can either give a complete URI or one of several +shortcuts like ``mysql`` (these shortcuts are defined in the top of +``tests/dbtest.py``). All the tests are modules in ``sqlobject/tests``. Each module tests one kind of feature, more or less. If you are testing a module, call |
|
From: <sub...@co...> - 2008-07-23 13:57:49
|
Author: phd Date: 2008-07-23 07:57:48 -0600 (Wed, 23 Jul 2008) New Revision: 3520 Modified: SQLObject/branches/0.10/docs/DeveloperGuide.txt Log: Minor documentation update - fixed devguide on how to pass DB URI to tests. Modified: SQLObject/branches/0.10/docs/DeveloperGuide.txt =================================================================== --- SQLObject/branches/0.10/docs/DeveloperGuide.txt 2008-07-23 13:57:17 UTC (rev 3519) +++ SQLObject/branches/0.10/docs/DeveloperGuide.txt 2008-07-23 13:57:48 UTC (rev 3520) @@ -152,11 +152,9 @@ .. _getting started: http://codespeak.net/py/dist/test.html#starting-point-py-test-command-line-tool To actually run the test, you have to give it a database to connect -to. You do this with the ``TESTDB`` environmental variable (right now -py.test doesn't have a better way to add custom options). You can -give the complete URI to access your test database, or you can give it -a shortcut like ``mysql`` (these shortcuts are defined in the top of -``tests/dbtest.py``. +to. You do so with the option "-D". You can either give a complete URI or one of several +shortcuts like ``mysql`` (these shortcuts are defined in the top of +``tests/dbtest.py``). All the tests are modules in ``sqlobject/tests``. Each module tests one kind of feature, more or less. If you are testing a module, call |
|
From: <sub...@co...> - 2008-07-23 13:57:23
|
Author: phd Date: 2008-07-23 07:57:17 -0600 (Wed, 23 Jul 2008) New Revision: 3519 Modified: SQLObject/branches/0.9/docs/DeveloperGuide.txt Log: Minor documentation update - fixed devguide on how to pass DB URI to tests. Modified: SQLObject/branches/0.9/docs/DeveloperGuide.txt =================================================================== --- SQLObject/branches/0.9/docs/DeveloperGuide.txt 2008-07-19 23:30:05 UTC (rev 3518) +++ SQLObject/branches/0.9/docs/DeveloperGuide.txt 2008-07-23 13:57:17 UTC (rev 3519) @@ -152,11 +152,9 @@ .. _getting started: http://codespeak.net/py/dist/test.html#starting-point-py-test-command-line-tool To actually run the test, you have to give it a database to connect -to. You do this with the ``TESTDB`` environmental variable (right now -py.test doesn't have a better way to add custom options). You can -give the complete URI to access your test database, or you can give it -a shortcut like ``mysql`` (these shortcuts are defined in the top of -``tests/dbtest.py``. +to. You do so with the option "-D". You can either give a complete URI or one of several +shortcuts like ``mysql`` (these shortcuts are defined in the top of +``tests/dbtest.py``). All the tests are modules in ``sqlobject/tests``. Each module tests one kind of feature, more or less. If you are testing a module, call |
|
From: SourceForge.net <no...@so...> - 2008-07-22 15:33:19
|
Bugs item #2024794, was opened at 2008-07-22 08:33 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=2024794&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: General Group: SQLObject release (specify) Status: Open Resolution: None Priority: 5 Private: No Submitted By: Ray Van dolson (rayvd) Assigned to: Nobody/Anonymous (nobody) Summary: Using idName with fromDatabase; id col issues Initial Comment: See this post: http://thread.gmane.org/gmane.comp.python.sqlobject/9360 When using fromDatabase = True with idName: class SystemsInfo(SQLObject): class sqlmeta: fromDatabase = True table = 'SystemsInfo' idType = str idName = 'SystemName' lazyUpdate = True .. an attempt to insert a new row with all other columns but the index (SystemName) defined results in a duplicate column error: item = SystemsInfo(id='uniquename') SystemName is used both as the id column and is in place in the normal column listing. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=2024794&group_id=74338 |
|
From: <sub...@co...> - 2008-07-17 13:27:55
|
Author: phd Date: 2008-07-17 07:13:08 -0600 (Thu, 17 Jul 2008) New Revision: 3510 Added: SQLObject/branches/0.10/sqlobject/tests/test_default_style.py Modified: SQLObject/branches/0.10/docs/News.txt Log: Merged r3509 from the 0.9 branch: added test_default_style.py from the SF patch 2007233. Modified: SQLObject/branches/0.10/docs/News.txt =================================================================== --- SQLObject/branches/0.10/docs/News.txt 2008-07-17 13:10:35 UTC (rev 3509) +++ SQLObject/branches/0.10/docs/News.txt 2008-07-17 13:13:08 UTC (rev 3510) @@ -104,6 +104,8 @@ * Convert decimal.to_eng_string() to str to work around a bug in Python 2.5.2; see http://mail.python.org/pipermail/python-dev/2008-March/078189.html +* Added test_default_style.py. + SQLObject 0.9.7 =============== Copied: SQLObject/branches/0.10/sqlobject/tests/test_default_style.py (from rev 3509, SQLObject/branches/0.9/sqlobject/tests/test_default_style.py) =================================================================== --- SQLObject/branches/0.10/sqlobject/tests/test_default_style.py (rev 0) +++ SQLObject/branches/0.10/sqlobject/tests/test_default_style.py 2008-07-17 13:13:08 UTC (rev 3510) @@ -0,0 +1,58 @@ +""" +Test the default styles, to guarantee consistency. +""" + +from sqlobject import * +from sqlobject.tests.dbtest import * +from sqlobject.styles import Style, MixedCaseUnderscoreStyle, MixedCaseStyle + +#hash of styles versus the database names resulting from 'columns' below +columns = ["ABCUpper", "abc_lower", "ABCamelCaseColumn"] +styles = {Style:columns, + MixedCaseUnderscoreStyle:["abc_upper", "abc_lower", "ab_camel_case_column"], + MixedCaseStyle:["ABCUpper", "Abc_lower", "ABCamelCaseColumn"], + } + +#hash of styles versus the database names resulting from a foreign key named 'FKey' +fkey = ForeignKey("DefaultStyleTest", name="FKey") +fkeys = {Style:"FKeyID", + MixedCaseUnderscoreStyle:"f_key_id", + MixedCaseStyle:"FKeyID", + } + + +def make_columns(): + global columns + columns = [] + for col_name in columns: + columns.append(StringCol(name=col_name, length=10)) + + +def do_col_test(DefaultStyleTest, style, dbnames): + DefaultStyleTest.sqlmeta.style = style() + for col, old_dbname in zip(columns, dbnames): + DefaultStyleTest.sqlmeta.addColumn(col) + try: + new_dbname = DefaultStyleTest.sqlmeta.columns[col.name].dbName + assert new_dbname == old_dbname + finally: + if col.name in DefaultStyleTest.sqlmeta.columns: + DefaultStyleTest.sqlmeta.delColumn(col) + +def do_fkey_test(DefaultStyleTest, style, dbname): + DefaultStyleTest.sqlmeta.style = style() + DefaultStyleTest.sqlmeta.addColumn(fkey) + try: + assert DefaultStyleTest.sqlmeta.columns.keys()[0] == "FKeyID" + assert DefaultStyleTest.sqlmeta.columns.values()[0].dbName == dbname + finally: + DefaultStyleTest.sqlmeta.delColumn(fkey) + +class DefaultStyleTest(SQLObject): + pass + +def test_default_styles(): + make_columns() + for style in styles: + yield do_col_test, DefaultStyleTest, style, styles[style] + yield do_fkey_test, DefaultStyleTest, style, fkeys[style] |
|
From: <sub...@co...> - 2008-07-17 13:23:04
|
Author: phd Date: 2008-07-17 07:14:02 -0600 (Thu, 17 Jul 2008) New Revision: 3511 Added: SQLObject/trunk/sqlobject/tests/test_default_style.py Modified: SQLObject/trunk/docs/News.txt Log: Merged r3509 from the 0.9 branch: added test_default_style.py from the SF patch 2007233. Modified: SQLObject/trunk/docs/News.txt =================================================================== --- SQLObject/trunk/docs/News.txt 2008-07-17 13:13:08 UTC (rev 3510) +++ SQLObject/trunk/docs/News.txt 2008-07-17 13:14:02 UTC (rev 3511) @@ -130,6 +130,8 @@ * Convert decimal.to_eng_string() to str to work around a bug in Python 2.5.2; see http://mail.python.org/pipermail/python-dev/2008-March/078189.html +* Added test_default_style.py. + SQLObject 0.9.7 =============== Copied: SQLObject/trunk/sqlobject/tests/test_default_style.py (from rev 3510, SQLObject/branches/0.10/sqlobject/tests/test_default_style.py) =================================================================== --- SQLObject/trunk/sqlobject/tests/test_default_style.py (rev 0) +++ SQLObject/trunk/sqlobject/tests/test_default_style.py 2008-07-17 13:14:02 UTC (rev 3511) @@ -0,0 +1,58 @@ +""" +Test the default styles, to guarantee consistency. +""" + +from sqlobject import * +from sqlobject.tests.dbtest import * +from sqlobject.styles import Style, MixedCaseUnderscoreStyle, MixedCaseStyle + +#hash of styles versus the database names resulting from 'columns' below +columns = ["ABCUpper", "abc_lower", "ABCamelCaseColumn"] +styles = {Style:columns, + MixedCaseUnderscoreStyle:["abc_upper", "abc_lower", "ab_camel_case_column"], + MixedCaseStyle:["ABCUpper", "Abc_lower", "ABCamelCaseColumn"], + } + +#hash of styles versus the database names resulting from a foreign key named 'FKey' +fkey = ForeignKey("DefaultStyleTest", name="FKey") +fkeys = {Style:"FKeyID", + MixedCaseUnderscoreStyle:"f_key_id", + MixedCaseStyle:"FKeyID", + } + + +def make_columns(): + global columns + columns = [] + for col_name in columns: + columns.append(StringCol(name=col_name, length=10)) + + +def do_col_test(DefaultStyleTest, style, dbnames): + DefaultStyleTest.sqlmeta.style = style() + for col, old_dbname in zip(columns, dbnames): + DefaultStyleTest.sqlmeta.addColumn(col) + try: + new_dbname = DefaultStyleTest.sqlmeta.columns[col.name].dbName + assert new_dbname == old_dbname + finally: + if col.name in DefaultStyleTest.sqlmeta.columns: + DefaultStyleTest.sqlmeta.delColumn(col) + +def do_fkey_test(DefaultStyleTest, style, dbname): + DefaultStyleTest.sqlmeta.style = style() + DefaultStyleTest.sqlmeta.addColumn(fkey) + try: + assert DefaultStyleTest.sqlmeta.columns.keys()[0] == "FKeyID" + assert DefaultStyleTest.sqlmeta.columns.values()[0].dbName == dbname + finally: + DefaultStyleTest.sqlmeta.delColumn(fkey) + +class DefaultStyleTest(SQLObject): + pass + +def test_default_styles(): + make_columns() + for style in styles: + yield do_col_test, DefaultStyleTest, style, styles[style] + yield do_fkey_test, DefaultStyleTest, style, fkeys[style] |
|
From: <sub...@co...> - 2008-07-17 13:19:39
|
Author: phd Date: 2008-07-17 07:19:36 -0600 (Thu, 17 Jul 2008) New Revision: 3512 Added: SQLObject/trunk/sqlobject/include/hashcol.py Modified: SQLObject/trunk/docs/News.txt Log: Added sqlobject.include.hascol.HashCol from SF patch 2013132. Modified: SQLObject/trunk/docs/News.txt =================================================================== --- SQLObject/trunk/docs/News.txt 2008-07-17 13:14:02 UTC (rev 3511) +++ SQLObject/trunk/docs/News.txt 2008-07-17 13:19:36 UTC (rev 3512) @@ -30,9 +30,17 @@ * Use reversed() in manager/command.py instead of .__reversed__(). -* DecimalStringCol - similar to DecimalCol but stores data as strings to - work around problems in some drivers and type affinity problem in SQLite. +* Added DecimalStringCol - similar to DecimalCol but stores data as strings + to work around problems in some drivers and type affinity problem in + SQLite. +* Added sqlobject.include.hascol.HashCol - a column type that automatically + hashes anything going into it, and returns out an object that hashes + anything being compared to itself. Basically, it's good for really simple + one-way password fields, and it even supports the assignment of None to + indicate no password set. By default, it uses the md5 library for + hashing, but this can be changed in a HashCol definition. + SQLObject 0.10.3 ================ Added: SQLObject/trunk/sqlobject/include/hashcol.py =================================================================== --- SQLObject/trunk/sqlobject/include/hashcol.py (rev 0) +++ SQLObject/trunk/sqlobject/include/hashcol.py 2008-07-17 13:19:36 UTC (rev 3512) @@ -0,0 +1,62 @@ +__all__ = ['HashCol'] + +import sqlobject.col + +class DbHash: + """ Presents a comparison object for hashes, allowing plain text to be + automagically compared with the base content. """ + + def __init__( self, hash, hashMethod ): + self.hash = hash + self.hashMethod = hashMethod + + def __cmp__( self, other ): + if other is None: + if self.hash is None: + return 0 + return True + if not isinstance( other, basestring ): + raise TypeError( "A hash may only be compared with a string, or None." ) + return cmp( self.hashMethod( other ), self.hash ) + + def __repr__( self ): + return "<DbHash>" + +class HashValidator( sqlobject.col.StringValidator ): + """ Provides formal SQLObject validation services for the HashCol. """ + + def to_python( self, value, state ): + """ Passes out a hash object. """ + if value is None: + return None + return DbHash( hash = value, hashMethod = self.hashMethod ) + + def from_python( self, value, state ): + """ Store the given value as a MD5 hash, or None if specified. """ + if value is None: + return None + return self.hashMethod( value ) + +class SOHashCol( sqlobject.col.SOStringCol ): + """ The internal HashCol definition. By default, enforces a md5 digest. """ + + def __init__( self, **kw ): + if 'hashMethod' not in kw: + from md5 import md5 + self.hashMethod = lambda v: md5( v ).hexdigest() + if 'length' not in kw: + kw['length'] = 32 + else: + self.hashMethod = kw['hashMethod'] + del kw['hashMethod'] + super( sqlobject.col.SOStringCol, self ).__init__( **kw ) + + def createValidators( self ): + return [HashValidator( name=self.name, hashMethod=self.hashMethod )] + \ + super( SOHashCol, self ).createValidators() + +class HashCol( sqlobject.col.StringCol ): + """ End-user HashCol class. May be instantiated with 'hashMethod', a function + which returns the string hash of any other string (i.e. basestring). """ + + baseClass = SOHashCol |
|
From: SourceForge.net <no...@so...> - 2008-07-17 13:19:30
|
Patches item #2013132, was opened at 2008-07-08 09:08 Message generated for change (Comment added) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=2013132&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: Accepted Priority: 5 Private: Yes Submitted By: Nobody/Anonymous (nobody) >Assigned to: Oleg Broytmann (phd) Summary: HashCol type for passwords and the like Initial Comment: This is some fairly simple code for a HashCol, a column type that automatically hashes anything going into it, and returns out an object that hashes anything being compared to itself. Basically, it's great for really simple one-way password fields, and it even supports the assignment of None to indicate no password set. By default, it uses the md5 library for hashing, but this can be changed in a HashCol definition. The attached code could pretty neatly be slotted right into col.py within the source. sam...@gm... ---------------------------------------------------------------------- >Comment By: Oleg Broytmann (phd) Date: 2008-07-17 17:19 Message: Logged In: YES user_id=4799 Originator: NO Added as sqlobject.include.hascol.HashCol to the trunk. Thank you. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=2013132&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2008-07-17 13:14:30
|
Patches item #2007233, was opened at 2008-07-01 04:13 Message generated for change (Comment added) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=2007233&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: Accepted Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) >Assigned to: Oleg Broytmann (phd) Summary: More testing for styles Initial Comment: I've written some more tests for the built-in styles, in anticipation of adding customizable ForeignKey naming. In any case, these tests will help guarantee that the naming stays consistent. ---------------------------------------------------------------------- >Comment By: Oleg Broytmann (phd) Date: 2008-07-17 17:14 Message: Logged In: YES user_id=4799 Originator: NO Added to the repository at the revisions 3509-3511 (branches 0.9, 0.10 and the trunk). ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=2007233&group_id=74338 |
|
From: <sub...@co...> - 2008-07-17 13:10:42
|
Author: phd Date: 2008-07-17 07:10:35 -0600 (Thu, 17 Jul 2008) New Revision: 3509 Added: SQLObject/branches/0.9/sqlobject/tests/test_default_style.py Modified: SQLObject/branches/0.9/docs/News.txt Log: Added test_default_style.py from the SF patch 2007233. Modified: SQLObject/branches/0.9/docs/News.txt =================================================================== --- SQLObject/branches/0.9/docs/News.txt 2008-07-15 13:22:04 UTC (rev 3508) +++ SQLObject/branches/0.9/docs/News.txt 2008-07-17 13:10:35 UTC (rev 3509) @@ -13,6 +13,8 @@ * Convert decimal.to_eng_string() to str to work around a bug in Python 2.5.2; see http://mail.python.org/pipermail/python-dev/2008-March/078189.html +* Added test_default_style.py. + SQLObject 0.9.7 =============== Added: SQLObject/branches/0.9/sqlobject/tests/test_default_style.py =================================================================== --- SQLObject/branches/0.9/sqlobject/tests/test_default_style.py (rev 0) +++ SQLObject/branches/0.9/sqlobject/tests/test_default_style.py 2008-07-17 13:10:35 UTC (rev 3509) @@ -0,0 +1,58 @@ +""" +Test the default styles, to guarantee consistency. +""" + +from sqlobject import * +from sqlobject.tests.dbtest import * +from sqlobject.styles import Style, MixedCaseUnderscoreStyle, MixedCaseStyle + +#hash of styles versus the database names resulting from 'columns' below +columns = ["ABCUpper", "abc_lower", "ABCamelCaseColumn"] +styles = {Style:columns, + MixedCaseUnderscoreStyle:["abc_upper", "abc_lower", "ab_camel_case_column"], + MixedCaseStyle:["ABCUpper", "Abc_lower", "ABCamelCaseColumn"], + } + +#hash of styles versus the database names resulting from a foreign key named 'FKey' +fkey = ForeignKey("DefaultStyleTest", name="FKey") +fkeys = {Style:"FKeyID", + MixedCaseUnderscoreStyle:"f_key_id", + MixedCaseStyle:"FKeyID", + } + + +def make_columns(): + global columns + columns = [] + for col_name in columns: + columns.append(StringCol(name=col_name, length=10)) + + +def do_col_test(DefaultStyleTest, style, dbnames): + DefaultStyleTest.sqlmeta.style = style() + for col, old_dbname in zip(columns, dbnames): + DefaultStyleTest.sqlmeta.addColumn(col) + try: + new_dbname = DefaultStyleTest.sqlmeta.columns[col.name].dbName + assert new_dbname == old_dbname + finally: + if col.name in DefaultStyleTest.sqlmeta.columns: + DefaultStyleTest.sqlmeta.delColumn(col) + +def do_fkey_test(DefaultStyleTest, style, dbname): + DefaultStyleTest.sqlmeta.style = style() + DefaultStyleTest.sqlmeta.addColumn(fkey) + try: + assert DefaultStyleTest.sqlmeta.columns.keys()[0] == "FKeyID" + assert DefaultStyleTest.sqlmeta.columns.values()[0].dbName == dbname + finally: + DefaultStyleTest.sqlmeta.delColumn(fkey) + +class DefaultStyleTest(SQLObject): + pass + +def test_default_styles(): + make_columns() + for style in styles: + yield do_col_test, DefaultStyleTest, style, styles[style] + yield do_fkey_test, DefaultStyleTest, style, fkeys[style] |
|
From: <sub...@co...> - 2008-07-15 13:22:07
|
Author: dan
Date: 2008-07-15 07:22:04 -0600 (Tue, 15 Jul 2008)
New Revision: 3508
Modified:
SQLObject/branches/0.9/sqlobject/mysql/mysqlconnection.py
Log:
Fixed inconsistency with error message type when converting from mysql OperationalError to sqlobject OperationalError (backported from trunk)
Modified: SQLObject/branches/0.9/sqlobject/mysql/mysqlconnection.py
===================================================================
--- SQLObject/branches/0.9/sqlobject/mysql/mysqlconnection.py 2008-07-15 13:21:53 UTC (rev 3507)
+++ SQLObject/branches/0.9/sqlobject/mysql/mysqlconnection.py 2008-07-15 13:22:04 UTC (rev 3508)
@@ -5,8 +5,8 @@
MySQLdb = None
class ErrorMessage(str):
- def __new__(cls, e):
- obj = str.__new__(cls, e[1])
+ def __new__(cls, e, append_msg=''):
+ obj = str.__new__(cls, e[1] + append_msg)
obj.code = int(e[0])
obj.module = e.__module__
obj.exception = e.__class__.__name__
@@ -67,10 +67,8 @@
if MySQLdb.version_info[:3] >= (1, 2, 2):
conn.ping(True) # Attempt to reconnect. This setting is persistent.
except self.module.OperationalError, e:
- raise OperationalError(
- "%s; used connection string: host=%s, port=%s, db=%s, user=%s, pwd=%s" % (
- e, self.host, self.port, self.db, self.user, self.password)
- )
+ conninfo = "; used connection string: host=%(host)s, port=%(port)s, db=%(db)s, user=%(user)s" % self.__dict__
+ raise OperationalError(ErrorMessage(e, conninfo))
if hasattr(conn, 'autocommit'):
conn.autocommit(bool(self.autoCommit))
|
|
From: <sub...@co...> - 2008-07-15 13:21:54
|
Author: dan
Date: 2008-07-15 07:21:53 -0600 (Tue, 15 Jul 2008)
New Revision: 3507
Modified:
SQLObject/branches/0.10/sqlobject/mysql/mysqlconnection.py
Log:
Fixed inconsistency with error message type when converting from mysql OperationalError to sqlobject OperationalError (backported from trunk)
Modified: SQLObject/branches/0.10/sqlobject/mysql/mysqlconnection.py
===================================================================
--- SQLObject/branches/0.10/sqlobject/mysql/mysqlconnection.py 2008-07-15 13:21:27 UTC (rev 3506)
+++ SQLObject/branches/0.10/sqlobject/mysql/mysqlconnection.py 2008-07-15 13:21:53 UTC (rev 3507)
@@ -5,8 +5,8 @@
MySQLdb = None
class ErrorMessage(str):
- def __new__(cls, e):
- obj = str.__new__(cls, e[1])
+ def __new__(cls, e, append_msg=''):
+ obj = str.__new__(cls, e[1] + append_msg)
obj.code = int(e[0])
obj.module = e.__module__
obj.exception = e.__class__.__name__
@@ -72,10 +72,8 @@
if MySQLdb.version_info[:3] >= (1, 2, 2):
conn.ping(True) # Attempt to reconnect. This setting is persistent.
except self.module.OperationalError, e:
- raise OperationalError(
- "%s; used connection string: host=%s, port=%s, db=%s, user=%s, pwd=%s" % (
- e, self.host, self.port, self.db, self.user, self.password)
- )
+ conninfo = "; used connection string: host=%(host)s, port=%(port)s, db=%(db)s, user=%(user)s" % self.__dict__
+ raise OperationalError(ErrorMessage(e, conninfo))
if hasattr(conn, 'autocommit'):
conn.autocommit(bool(self.autoCommit))
|
|
From: <sub...@co...> - 2008-07-15 13:21:32
|
Author: dan
Date: 2008-07-15 07:21:27 -0600 (Tue, 15 Jul 2008)
New Revision: 3506
Modified:
SQLObject/trunk/sqlobject/mysql/mysqlconnection.py
Log:
Fixed inconsistency with error message type when converting from mysql OperationalError to sqlobject OperationalError
Modified: SQLObject/trunk/sqlobject/mysql/mysqlconnection.py
===================================================================
--- SQLObject/trunk/sqlobject/mysql/mysqlconnection.py 2008-07-14 11:59:41 UTC (rev 3505)
+++ SQLObject/trunk/sqlobject/mysql/mysqlconnection.py 2008-07-15 13:21:27 UTC (rev 3506)
@@ -5,8 +5,8 @@
MySQLdb = None
class ErrorMessage(str):
- def __new__(cls, e):
- obj = str.__new__(cls, e[1])
+ def __new__(cls, e, append_msg=''):
+ obj = str.__new__(cls, e[1] + append_msg)
obj.code = int(e[0])
obj.module = e.__module__
obj.exception = e.__class__.__name__
@@ -72,10 +72,8 @@
if MySQLdb.version_info[:3] >= (1, 2, 2):
conn.ping(True) # Attempt to reconnect. This setting is persistent.
except self.module.OperationalError, e:
- raise OperationalError(
- "%s; used connection string: host=%s, port=%s, db=%s, user=%s, pwd=%s" % (
- e, self.host, self.port, self.db, self.user, self.password)
- )
+ conninfo = "; used connection string: host=%(host)s, port=%(port)s, db=%(db)s, user=%(user)s" % self.__dict__
+ raise OperationalError(ErrorMessage(e, conninfo))
if hasattr(conn, 'autocommit'):
conn.autocommit(bool(self.autoCommit))
|
|
From: <sub...@co...> - 2008-07-14 11:59:45
|
Author: phd
Date: 2008-07-14 05:59:41 -0600 (Mon, 14 Jul 2008)
New Revision: 3505
Modified:
SQLObject/trunk/docs/SQLObject.txt
Log:
DecimalStringColumn cannot be used in expressions and ordering.
Modified: SQLObject/trunk/docs/SQLObject.txt
===================================================================
--- SQLObject/trunk/docs/SQLObject.txt 2008-07-11 16:37:56 UTC (rev 3504)
+++ SQLObject/trunk/docs/SQLObject.txt 2008-07-14 11:59:41 UTC (rev 3505)
@@ -1137,7 +1137,9 @@
`DecimalStringCol`:
Similar to `DecimalCol` but stores data as strings to work around
- problems in some drivers and type affinity problem in SQLite.
+ problems in some drivers and type affinity problem in SQLite. As it
+ stores data as strings the column cannot be used in SQL expressions
+ (column1 + column2) and probably will has problems with ORDER BY.
`EnumCol`:
One of several string values -- give the possible strings as a
|