sqlobject-cvs Mailing List for SQLObject (Page 76)
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: <sub...@co...> - 2008-01-10 12:27:56
|
Author: phd
Date: 2008-01-10 05:27:44 -0700 (Thu, 10 Jan 2008)
New Revision: 3204
Modified:
SQLObject/branches/0.8/docs/News.txt
SQLObject/branches/0.8/setup.py
Log:
Releasing 0.8.7.
Modified: SQLObject/branches/0.8/docs/News.txt
===================================================================
--- SQLObject/branches/0.8/docs/News.txt 2008-01-10 12:19:58 UTC (rev 3203)
+++ SQLObject/branches/0.8/docs/News.txt 2008-01-10 12:27:44 UTC (rev 3204)
@@ -10,6 +10,8 @@
SQLObject 0.8.7
===============
+Released 10 Jan 2008.
+
* A number of changes ported from `SQLObject 0.7.10`_.
SQLObject 0.8.6
@@ -197,6 +199,8 @@
SQLObject 0.7.10
================
+Released 10 Jan 2008.
+
* With PySQLite2 do not use encode()/decode() from PySQLite1 - always use
base64 for BLOBs.
Modified: SQLObject/branches/0.8/setup.py
===================================================================
--- SQLObject/branches/0.8/setup.py 2008-01-10 12:19:58 UTC (rev 3203)
+++ SQLObject/branches/0.8/setup.py 2008-01-10 12:27:44 UTC (rev 3204)
@@ -28,7 +28,7 @@
"""
setup(name="SQLObject",
- version="0.8.6",
+ version="0.8",
description="Object-Relational Manager, aka database wrapper",
long_description="""\
SQLObject is a popular *Object Relational Manager* for providing an
@@ -56,7 +56,7 @@
author="Ian Bicking",
author_email="ia...@co...",
url="http://sqlobject.org/",
- download_url="http://cheeseshop.python.org/pypi/SQLObject/0.8.6",
+ download_url="http://cheeseshop.python.org/pypi/SQLObject/0.8",
license="LGPL",
packages=["sqlobject"] + ['sqlobject.%s' % package for package in subpackages],
scripts=["scripts/sqlobject-admin"],
|
|
From: <sub...@co...> - 2008-01-10 12:20:05
|
Author: phd
Date: 2008-01-10 05:19:58 -0700 (Thu, 10 Jan 2008)
New Revision: 3203
Modified:
SQLObject/tags/0.7.10/setup.cfg
SQLObject/tags/0.7.10/setup.py
SQLObject/tags/0.7.10/sqlobject/__init__.py
SQLObject/tags/0.7.10/sqlobject/main.py
Log:
SQLObject 0.7.10 released 10 Jan 2008.
Modified: SQLObject/tags/0.7.10/setup.cfg
===================================================================
--- SQLObject/tags/0.7.10/setup.cfg 2008-01-10 12:16:55 UTC (rev 3202)
+++ SQLObject/tags/0.7.10/setup.cfg 2008-01-10 12:19:58 UTC (rev 3203)
@@ -1,7 +1,3 @@
-[egg_info]
-tag_build = a
-tag_svn_revision = true
-
[pudge]
title = SQLObject
dest = docs/html
Modified: SQLObject/tags/0.7.10/setup.py
===================================================================
--- SQLObject/tags/0.7.10/setup.py 2008-01-10 12:16:55 UTC (rev 3202)
+++ SQLObject/tags/0.7.10/setup.py 2008-01-10 12:19:58 UTC (rev 3203)
@@ -19,7 +19,7 @@
DistributionMetadata.download_url = None
setup(name="SQLObject",
- version="0.7",
+ version="0.7.10",
description="Object-Relational Manager, aka database wrapper",
long_description="""\
SQLObject is a popular *Object Relational Manager* for providing an
@@ -52,7 +52,7 @@
author="Ian Bicking",
author_email="ia...@co...",
url="http://sqlobject.org",
- download_url="http://cheeseshop.python.org/pypi/SQLObject/0.7",
+ download_url="http://cheeseshop.python.org/pypi/SQLObject/0.7.10",
license="LGPL",
packages=["sqlobject"] + ['sqlobject.%s' % package for package in subpackages],
scripts=["scripts/sqlobject-admin"],
Modified: SQLObject/tags/0.7.10/sqlobject/__init__.py
===================================================================
--- SQLObject/tags/0.7.10/sqlobject/__init__.py 2008-01-10 12:16:55 UTC (rev 3202)
+++ SQLObject/tags/0.7.10/sqlobject/__init__.py 2008-01-10 12:19:58 UTC (rev 3203)
@@ -1,5 +1,5 @@
"""
-SQLObject 0.7
+SQLObject 0.7.10
"""
from main import *
Modified: SQLObject/tags/0.7.10/sqlobject/main.py
===================================================================
--- SQLObject/tags/0.7.10/sqlobject/main.py 2008-01-10 12:16:55 UTC (rev 3202)
+++ SQLObject/tags/0.7.10/sqlobject/main.py 2008-01-10 12:19:58 UTC (rev 3203)
@@ -1,6 +1,6 @@
"""
-SQLObject 0.7
--------------
+SQLObject 0.7.10
+----------------
:author: Ian Bicking <ia...@co...>
|
|
From: <sub...@co...> - 2008-01-10 12:17:02
|
Author: phd Date: 2008-01-10 05:16:55 -0700 (Thu, 10 Jan 2008) New Revision: 3202 Added: SQLObject/tags/0.7.10/ Log: Tagging 0.7.10 Copied: SQLObject/tags/0.7.10 (from rev 3201, SQLObject/branches/0.7) |
|
From: <sub...@co...> - 2007-12-31 12:46:54
|
Author: phd
Date: 2007-12-31 05:46:49 -0700 (Mon, 31 Dec 2007)
New Revision: 3187
Modified:
SQLObject/trunk/docs/News.txt
SQLObject/trunk/sqlobject/mysql/mysqlconnection.py
Log:
A patch by Luca Longinotti <ch...@ge...>:
MySQLConnection (and DB URI) accept a number of SSL-related parameters:
ssl_key, ssl_cert, ssl_ca, ssl_capath.
Modified: SQLObject/trunk/docs/News.txt
===================================================================
--- SQLObject/trunk/docs/News.txt 2007-12-30 22:36:17 UTC (rev 3186)
+++ SQLObject/trunk/docs/News.txt 2007-12-31 12:46:49 UTC (rev 3187)
@@ -60,6 +60,9 @@
considered equal is they have the same id; other methods return
NotImplemented.
+* MySQLConnection (and DB URI) accept a number of SSL-related parameters:
+ ssl_key, ssl_cert, ssl_ca, ssl_capath.
+
* A number of changes ported from `SQLObject 0.7.10`_.
SQLObject 0.9.3
Modified: SQLObject/trunk/sqlobject/mysql/mysqlconnection.py
===================================================================
--- SQLObject/trunk/sqlobject/mysql/mysqlconnection.py 2007-12-30 22:36:17 UTC (rev 3186)
+++ SQLObject/trunk/sqlobject/mysql/mysqlconnection.py 2007-12-31 12:46:49 UTC (rev 3187)
@@ -37,6 +37,11 @@
"client_flag", "local_infile"):
if key in kw:
self.kw[key] = int(kw.pop(key))
+ for key in ("ssl_key", "ssl_cert", "ssl_ca", "ssl_capath"):
+ if key in kw:
+ if "ssl" not in self.kw:
+ self.kw["ssl"] = {}
+ self.kw["ssl"][key[4:]] = kw.pop(key)
if "charset" in kw:
self.dbEncoding = self.kw["charset"] = kw.pop("charset")
else:
|
|
From: SourceForge.net <no...@so...> - 2007-12-26 12:33:09
|
Bugs item #1839646, was opened at 2007-11-27 20:33 Message generated for change (Comment added) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1839646&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: Closed >Resolution: Accepted Priority: 5 Private: No Submitted By: Peter Russell (psr) >Assigned to: Oleg Broytmann (phd) Summary: SQLObject instances of same class with same ID should be == Initial Comment: I've got a failing unittest in some code where I assert that: group in member.groups where Group and Member are InheritableSQLObject classes, related by a RelatedJoin. The test loads group and member, then calls the "add a member to a group" controller of my web app, to add the member to the group. The assertion fails despite the controller working correctly, because SQLObject doesn't override __eq__ to ensure that two different python instances pointing at the same row are equal. Presumably adding the following to the definition of SQLObject would work def __eq__(self, other): if self.__class__ == other.__class__: if self.id == other.id: return True return False This is occuring with an SQLite in-memory database, with SQLObject 0.7.7 (I know I should upgrade!) ---------------------------------------------------------------------- >Comment By: Oleg Broytmann (phd) Date: 2007-12-26 15:33 Message: Logged In: YES user_id=4799 Originator: NO Implemented in the trunk. I added all rich comparison methods and a test. Committed to the trunk at the revision 3184. Will be in SQLObject 0.10. Thank you! ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1839646&group_id=74338 |
|
From: <sub...@co...> - 2007-12-26 12:31:16
|
Author: phd
Date: 2007-12-26 05:31:08 -0700 (Wed, 26 Dec 2007)
New Revision: 3184
Added:
SQLObject/trunk/sqlobject/tests/test_comparison.py
Modified:
SQLObject/trunk/docs/News.txt
SQLObject/trunk/sqlobject/main.py
Log:
Added rich comparison methods.
Modified: SQLObject/trunk/docs/News.txt
===================================================================
--- SQLObject/trunk/docs/News.txt 2007-12-20 00:16:20 UTC (rev 3183)
+++ SQLObject/trunk/docs/News.txt 2007-12-26 12:31:08 UTC (rev 3184)
@@ -56,6 +56,10 @@
* Changed the implementation type in BoolCol under SQLite from TINYINT to
BOOLEAN and made fromDatabase machinery to recognize it.
+* Added rich comparison methods; SQLObjects of the same class are
+ considered equal is they have the same id; other methods return
+ NotImplemented.
+
* A number of changes ported from `SQLObject 0.7.10`_.
SQLObject 0.9.3
Modified: SQLObject/trunk/sqlobject/main.py
===================================================================
--- SQLObject/trunk/sqlobject/main.py 2007-12-20 00:16:20 UTC (rev 3183)
+++ SQLObject/trunk/sqlobject/main.py 2007-12-26 12:31:08 UTC (rev 3184)
@@ -1581,15 +1581,37 @@
if isinstance(value, basestring):
value = dbconnection.connectionForURI(value)
cls._connection = value
+
setConnection = classmethod(setConnection)
def __sqlrepr__(self, db):
return sqlbuilder.sqlrepr(self.__class__.q.id==self.id)
-
+
def tablesUsedImmediate(self):
return [self.__class__.q]
+ def __eq__(self, other):
+ if self.__class__ is other.__class__:
+ if self.id == other.id:
+ return True
+ return False
+ def __ne__(self, other):
+ return not self.__eq__(other)
+
+ def __lt__(self, other):
+ return NotImplemented
+
+ def __le__(self, other):
+ return NotImplemented
+
+ def __gt__(self, other):
+ return NotImplemented
+
+ def __ge__(self, other):
+ return NotImplemented
+
+
def capitalize(name):
return name[0].capitalize() + name[1:]
Added: SQLObject/trunk/sqlobject/tests/test_comparison.py
===================================================================
--- SQLObject/trunk/sqlobject/tests/test_comparison.py (rev 0)
+++ SQLObject/trunk/sqlobject/tests/test_comparison.py 2007-12-26 12:31:08 UTC (rev 3184)
@@ -0,0 +1,24 @@
+from sqlobject import *
+from sqlobject.tests.dbtest import *
+
+class TestComparison(SQLObject):
+ pass
+
+def test_eq():
+ setupClass(TestComparison)
+ t1 = TestComparison()
+ t2 = TestComparison()
+
+ TestComparison._connection.cache.clear()
+ t3 = TestComparison.get(1)
+ t4 = TestComparison.get(2)
+
+ assert t1.id == t3.id
+ assert t2.id == t4.id
+ assert t1 is not t3
+ assert t2 is not t4
+ assert t1 == t3
+ assert t2 == t4
+ assert t1 <> t2
+ assert t1 < t2
+ assert not (t1 >= t2)
|
|
From: SourceForge.net <no...@so...> - 2007-12-26 11:54:21
|
Bugs item #1825466, was opened at 2007-11-04 11:21 Message generated for change (Comment added) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1825466&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: Firebird/Interbase Group: SQLObject release (specify) >Status: Closed >Resolution: Wont Fix Priority: 5 Private: No Submitted By: Igor Aguiar (igor_aguiar) >Assigned to: Oleg Broytmann (phd) Summary: Reserved words as table/column name in Firebird Initial Comment: Hi, first of all I would like to thank you guys for this amazing software. I'm pretty new to Python and I was playing with SQLObject using the IDLE IDE, when I tried to run the following code: #--- START OF CODE from sqlobject import * from sqlobject.inheritance import InheritableSQLObject con = connectionForURI('firebird://SYSDBA:masterkey@localhost//var/lib/firebird2/data/sqlobj.fdb') sqlhub.processConnection = con class Person(InheritableSQLObject): firstName = StringCol(length=100, notNone=True) middleInitial = StringCol(length = 1, default = None) lastName = StringCol(length=100, notNone=True) class User(Person): login = StringCol(length=20, notNone=True, unique=True) password = StringCol(length=20, notNone=True) Person.createTable() User.createTable() #--- END OF CODE But a error occurs when the "User.createTable()" is performed. Below is the error: #--- START OF ERROR Traceback (most recent call last): File "<pyshell#21>", line 1, in <module> User.createTable() File "/usr/lib/python2.5/site-packages/SQLObject-0.9.2-py2.5.egg/sqlobject/main.py", line 1378, in createTable constraints = conn.createTable(cls) File "/usr/lib/python2.5/site-packages/SQLObject-0.9.2-py2.5.egg/sqlobject/firebird/firebirdconnection.py", line 128, in createTable (soClass.sqlmeta.table, self.createColumns(soClass))) File "/usr/lib/python2.5/site-packages/SQLObject-0.9.2-py2.5.egg/sqlobject/dbconnection.py", line 342, in query return self._runWithConnection(self._query, s) File "/usr/lib/python2.5/site-packages/SQLObject-0.9.2-py2.5.egg/sqlobject/firebird/firebirdconnection.py", line 59, in _runWithConnection val = meth(conn, *args) File "/usr/lib/python2.5/site-packages/SQLObject-0.9.2-py2.5.egg/sqlobject/dbconnection.py", line 339, in _query self._executeRetry(conn, conn.cursor(), s) File "/usr/lib/python2.5/site-packages/SQLObject-0.9.2-py2.5.egg/sqlobject/dbconnection.py", line 334, in _executeRetry return cursor.execute(query) File "/var/lib/python-support/python2.5/kinterbasdb/__init__.py", line 1594, in execute self.description = _k.execute(self._C_cursor, sql, params) ProgrammingError: (-104, 'isc_dsql_prepare: Dynamic SQL Error. SQL error code = -104. Token unknown - line 1, char 14. user. ') #--- END OF ERROR Looking at the IDLE's Stack Viewer, I noticed that the SQL command generated to create the User table was something like this: 'CREATE TABLE user (\n id INT NOT NULL PRIMAR...AR(20) NOT NULL,\n child_name VARCHAR(255)\n)' The problem, as you probably already noticed, is that USER is a reserved word, and Firebird won't let a table with this name be created. Maybe surrounding the table's name with quotes would be a solution. This is my configuration: Ubuntu 7.04, python 2.5, SQLObject 0.9.2 and FirebirdSQL 1.5.3.4870 super server. Best regards, Igor ---------------------------------------------------------------------- >Comment By: Oleg Broytmann (phd) Date: 2007-12-26 14:54 Message: Logged In: YES user_id=4799 Originator: NO You can easily change the name of the table: either renmae the class to Users, or add sqlmeta to it: class User(SQLobject): class sqlmeta: table = "Users" ---------------------------------------------------------------------- Comment By: Igor Aguiar (igor_aguiar) Date: 2007-11-04 21:25 Message: Logged In: YES user_id=1929062 Originator: YES Or "sqlmeta" can be used :) I guess I posted too early... ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1825466&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2007-12-26 11:50:56
|
Bugs item #1690105, was opened at 2007-03-28 23:10 Message generated for change (Comment added) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1690105&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: MySQL Group: None >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Mirinde Fekus (junas) >Assigned to: Oleg Broytmann (phd) Summary: UnicodeEncodeError: 'latin-1' codec can't encode characters Initial Comment: I have this http://pylonshq.com/pasties/198 after upgrading mysqldb to 1.2.2 from 1.2.1 when selecting by value that contains non-latin characters: res = list(model.Tag.selectBy(tag = tag)) the connection string is sqlobject.dburi = mysql://****:****@localhost/pyneohuman?sqlobject_encoding=utf-8&charset=utf8 in development.ini so it's not latin-1... any ideas? ---------------------------------------------------------------------- >Comment By: Oleg Broytmann (phd) Date: 2007-12-26 14:50 Message: Logged In: YES user_id=4799 Originator: NO The patch you are proposing here has been applied in the repository. Will be in 0.7.10, 0.8.7 and 0.9.3 when they will be released. ---------------------------------------------------------------------- Comment By: Viktor Ferenczi (complex) Date: 2007-08-26 20:40 Message: Logged In: YES user_id=142612 Originator: NO My config: Python 2.5.1, SQLObject 0.9.1, MySQL 4.1.11, MySQL-python-1.2.2 DB with InnoDB tables, utf8_general_ci everywhere. SET NAMES utf8 issued as first SQL statement. This bug also appears in 0.9.1. Now works fine with modified mysql/mysqlconnection.py: @@ -28,10 +28,6 @@ self.user = user self.password = password self.kw = {} - if MySQLdb.version_info[:3] >= (1, 2, 1): - self.need_unicode = True - else: - self.need_unicode = False for key in ("unix_socket", "init_command", "read_default_file", "read_default_group", "conv"): if key in kw: @@ -107,10 +103,6 @@ # done by calling ping(True) on the connection. for count in range(3): try: - # For MySQLdb 1.2.1 and later, we go - # encoding->unicode->charset (in the mysql db) - if self.need_unicode and not isinstance(query, unicode): - query = unicode(query, self.encoding) return cursor.execute(query) except MySQLdb.OperationalError, e: if e.args[0] in (MySQLdb.constants.CR.SERVER_GONE_ERROR, MySQLdb.constants.CR.SERVER_LOST): and DB URI options: ?use_unicode=1&charset=utf8 It seems to me that the need_unicode stuff is somehow buggy and not required, at least in my case. ---------------------------------------------------------------------- Comment By: Mirinde Fekus (junas) Date: 2007-03-29 11:35 Message: Logged In: YES user_id=1304728 Originator: YES SQLObject-0.8.1-py2.4 ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2007-03-28 23:27 Message: Logged In: YES user_id=4799 Originator: NO What is the version of SQLObject? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1690105&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2007-12-22 03:07:36
|
Patches item #1407684, was opened at 2006-01-17 08:35 Message generated for change (Comment added) made by j3z You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1407684&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: object initialization threading issue Initial Comment: The creation of SQL objects is not threadsafe. After stressing a TurboGears app with ab2 with multiple concurrent connections to a threaded server, the log gets filled with tracebacks like these: 15/Jan/2006:22:05:00 HTTP INFO Traceback (most recent call last): File "/usr/lib/python2.4/site-packages/CherryPy-2.2.0beta-py2.4.egg/ cherrypy/_cp httptools.py", line 96, in _run applyFilters('before_main') File "/usr/lib/python2.4/site-packages/CherryPy-2.2.0beta-py2.4.egg/ cherrypy/fil ters/__init__.py", line 131, in applyFilters method() File "/home/alberto/turbogears/turbogears/visit.py", line 99, in beforeMain visit=self.get_visit() File "/home/alberto/turbogears/turbogears/visit.py", line 139, in get_visit return self.new_visit() File "/home/alberto/turbogears/turbogears/visit.py", line 122, in new_visit visit= TG_Visit( visit_key=visit_key, expiry=now+self.timeout ) File "/usr/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1500- py2.4.egg/sqlobj ect/main.py", line 1197, in __init__ self._create(id, **kw) File "/usr/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1500- py2.4.egg/sqlobj ect/main.py", line 1221, in _create self.set(**kw) File "/usr/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1500- py2.4.egg/sqlobj ect/main.py", line 1142, in set self._connection._SO_update(self, args) File "/usr/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1500- py2.4.egg/sqlobj ect/dbconnection.py", line 561, in _SO_update self.query("UPDATE %s SET %s WHERE %s = %s" % AttributeError: 'TG_Visit' object has no attribute 'id' 15/Jan/2006:22:05:00 HTTP INFO Traceback (most recent call last): File "/usr/lib/python2.4/site-packages/CherryPy-2.2.0beta-py2.4.egg/ cherrypy/_cp httptools.py", line 96, in _run applyFilters('before_main') File "/usr/lib/python2.4/site-packages/CherryPy-2.2.0beta-py2.4.egg/ cherrypy/fil ters/__init__.py", line 131, in applyFilters method() File "/home/alberto/turbogears/turbogears/visit.py", line 99, in beforeMain visit=self.get_visit() File "/home/alberto/turbogears/turbogears/visit.py", line 139, in get_visit return self.new_visit() File "/home/alberto/turbogears/turbogears/visit.py", line 122, in new_visit visit= TG_Visit( visit_key=visit_key, expiry=now+self.timeout ) File "/usr/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1500- py2.4.egg/sqlobj ect/main.py", line 1197, in __init__ self._create(id, **kw) File "/usr/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1500- py2.4.egg/sqlobj ect/main.py", line 1224, in _create self._SO_finishCreate(id) File "/usr/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1500- py2.4.egg/sqlobj ect/main.py", line 1242, in _SO_finishCreate del self.sqlmeta._creating AttributeError: _creating I've found at http://pythonpaste.org/archives/message/ 20051202.223718.a3adcfaa.en.html a solution to the problem, which is overriding __init__ on SQLObject subclasses by wrapping SQLObject.__init__ with a mutex acquisition and release. I've made a patch for main.py which generalizes this approach and wraps __init__ for every SQLObject created. Tested under my environment and works fine. The patch is also posted at the turbogears Trac at http:// trac.turbogears.org/turbogears/attachment/ticket/397/ sqlobject_threading.patch Cheers, Alberto Valverde al...@to... ---------------------------------------------------------------------- Comment By: Jeremy Field (j3z) Date: 2007-12-22 14:07 Message: Logged In: YES user_id=932673 Originator: NO I think I am experiencing this or a similar problem in SQLObject 0.9.2. I've written a simple SQLObject subclass (A) within a fairly straightforward schema. It fails to instantiate, giving the error partially reproduced below. Interestingly, it has only started to fail since I added another SQLObject subclass (B) to the schema. This second subclass has a many-to-one relationship to the first, and was inserted between (A) and a third subclass (C) as follows: Before: A -one-to-many-> C After: A -one-to-many-> B -one-to-many-> C I have to assume that this rearrangement is what's causing the problem, but can't for the life of me work out why! The problem occurs running a procedural script from the command line, so I don't see how threading could be the problem. Traceback (most recent call last): ... File "/usr/lib/python2.4/site-packages/sqlobject/declarative.py", line 98, in _wrapper return fn(self, *args, **kwargs) File "/usr/lib/python2.4/site-packages/sqlobject/main.py", line 1210, in __init__ self._create(id, **kw) File "/usr/lib/python2.4/site-packages/sqlobject/main.py", line 1238, in _create self.set(**kw) File "<string>", line 1, in <lambda> File "/usr/lib/python2.4/site-packages/sqlobject/main.py", line 975, in _SO_loadValue selectResults = self._connection._SO_selectOne(self, dbNames) File "/usr/lib/python2.4/site-packages/sqlobject/dbconnection.py", line 652, in _SO_selectOne return self.queryOne( AttributeError: 'A' object has no attribute 'id' I can provide more details if anyone can suggest where I should start. (Have already spent considerable time in the debugger, but have been unable to work out what's failing.) ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2006-01-31 07:21 Message: Logged In: YES user_id=4799 Applied at the revision 1546. Thank you! ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2006-01-17 08:39 Message: Logged In: NO Ooops, typo: the patch is for declarative.py, not main.py ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1407684&group_id=74338 |
|
From: <sub...@co...> - 2007-12-14 13:28:06
|
Author: phd
Date: 2007-12-14 06:28:01 -0700 (Fri, 14 Dec 2007)
New Revision: 3177
Modified:
SQLObject/trunk/docs/News.txt
SQLObject/trunk/sqlobject/main.py
Log:
Removed actively deprecated attributes; lowered deprecation level for other attributes to be removed after 0.10.
Modified: SQLObject/trunk/docs/News.txt
===================================================================
--- SQLObject/trunk/docs/News.txt 2007-12-14 13:27:08 UTC (rev 3176)
+++ SQLObject/trunk/docs/News.txt 2007-12-14 13:28:01 UTC (rev 3177)
@@ -16,6 +16,9 @@
* Dropped support for Python 2.2. The minimal version of Python for
SQLObject is 2.3 now.
+* Removed actively deprecated attributes;
+ lowered deprecation level for other attributes to be removed after 0.10.
+
* SQLBuilder Select supports the rest of SelectResults options (reversed,
distinct, joins, etc.)
Modified: SQLObject/trunk/sqlobject/main.py
===================================================================
--- SQLObject/trunk/sqlobject/main.py 2007-12-14 13:27:08 UTC (rev 3176)
+++ SQLObject/trunk/sqlobject/main.py 2007-12-14 13:28:01 UTC (rev 3177)
@@ -657,8 +657,8 @@
if warnings_level is not None and warnings_level <= level:
warnings.warn(message, DeprecationWarning, stacklevel=stacklevel)
-if sys.version_info[:3] < (2, 3, 0):
- deprecated("Support for Python 2.2 has been declared obsolete and will be removed in the next release of SQLObject")
+#if sys.version_info[:3] < (2, 4, 0):
+# deprecated("Support for Python 2.3 has been declared obsolete and will be removed in the next release of SQLObject")
def setDeprecationLevel(warning=1, exception=None):
"""
@@ -711,9 +711,6 @@
_inheritable = False # Is this class inheritable?
_parent = None # A reference to the parent instance
childName = None # Children name (to be able to get a subclass)
- # moved to sqlmeta in 0.8:
- _parentClass = _sqlmeta_attr('parentClass', 1)
- _childClasses = _sqlmeta_attr('childClasses', 1)
# The law of Demeter: the class should not call another classes by name
SelectResultsClass = SelectResults
@@ -802,21 +799,7 @@
classregistry.registry(cls.sqlmeta.registry).addClass(cls)
- _style = _sqlmeta_attr('style', 1)
- _table = _sqlmeta_attr('table', 1)
- _idName = _sqlmeta_attr('idName', 1)
- _lazyUpdate = _sqlmeta_attr('lazyUpdate', 1)
- _defaultOrder = _sqlmeta_attr('defaultOrder', 1)
- _cacheValues = _sqlmeta_attr('cacheValues', 1)
- _registry = _sqlmeta_attr('registry', 1)
- _idType = _sqlmeta_attr('idType', 1)
- _fromDatabase = _sqlmeta_attr('fromDatabase', 1)
- _expired = _sqlmeta_attr('expired', 2)
- addColumn = _sqlmeta_attr('addColumn', 1)
- delColumn = _sqlmeta_attr('delColumn', 1)
- addJoin = _sqlmeta_attr('addJoin', 1)
- delJoin = _sqlmeta_attr('delJoin', 1)
- addIndex = _sqlmeta_attr('addIndex', 1)
+ _expired = _sqlmeta_attr('expired', 1)
# @classmethod
def _SO_setupSqlmeta(cls, new_attrs, is_base):
@@ -868,22 +851,11 @@
been deprecated; they are moved to the sqlmeta class, and
a deprecation warning is given.
"""
- for attr in ['_table', '_lazyUpdate', '_style', '_idName',
- '_defaultOrder', '_cacheValues', '_registry',
- '_idType', '_fromDatabase', '_idSequence']:
- if new_attrs.has_key(attr):
- new_name = attr[1:]
- deprecated("%r is deprecated; please set the %r "
- "attribute in sqlmeta instead" %
- (attr, new_name), level=1,
- stacklevel=5)
- setattr(cls.sqlmeta, new_name, new_attrs[attr])
- delattr(cls, attr)
for attr in ['_expired']:
if new_attrs.has_key(attr):
deprecated("%r is deprecated and read-only; please do "
"not use it in your classes until it is fully "
- "deprecated" % attr, level=2, stacklevel=5)
+ "deprecated" % attr, level=1, stacklevel=5)
_SO_cleanDeprecatedAttrs = classmethod(_SO_cleanDeprecatedAttrs)
|
|
From: <sub...@co...> - 2007-12-14 13:27:13
|
Author: phd
Date: 2007-12-14 06:27:08 -0700 (Fri, 14 Dec 2007)
New Revision: 3176
Modified:
SQLObject/trunk/docs/News.txt
SQLObject/trunk/sqlobject/mysql/mysqlconnection.py
Log:
MySQLConnection doesn't convert query strings to unicode (but allows to
pass unicode query strings if the user build ones). DB URI parameter
sqlobject_encoding is no longer used.
Modified: SQLObject/trunk/docs/News.txt
===================================================================
--- SQLObject/trunk/docs/News.txt 2007-12-14 13:26:54 UTC (rev 3175)
+++ SQLObject/trunk/docs/News.txt 2007-12-14 13:27:08 UTC (rev 3176)
@@ -330,6 +330,10 @@
* With PySQLite2 do not use encode()/decode() from PySQLite1 - always use
base64 for BLOBs.
+* MySQLConnection doesn't convert query strings to unicode (but allows to
+ pass unicode query strings if the user build ones). DB URI parameter
+ sqlobject_encoding is no longer used.
+
SQLObject 0.7.9
===============
Modified: SQLObject/trunk/sqlobject/mysql/mysqlconnection.py
===================================================================
--- SQLObject/trunk/sqlobject/mysql/mysqlconnection.py 2007-12-14 13:26:54 UTC (rev 3175)
+++ SQLObject/trunk/sqlobject/mysql/mysqlconnection.py 2007-12-14 13:27:08 UTC (rev 3176)
@@ -1,6 +1,7 @@
+from sqlobject import col
from sqlobject.dbconnection import DBAPI
from sqlobject.dberrors import *
-from sqlobject import col
+from sqlobject.main import deprecated
MySQLdb = None
class ErrorMessage(str):
@@ -28,10 +29,6 @@
self.user = user
self.password = password
self.kw = {}
- if MySQLdb.version_info[:3] >= (1, 2, 1):
- self.need_unicode = True
- else:
- self.need_unicode = False
for key in ("unix_socket", "init_command",
"read_default_file", "read_default_group", "conv"):
if key in kw:
@@ -45,9 +42,8 @@
else:
self.dbEncoding = None
if "sqlobject_encoding" in kw:
- self.encoding = kw.pop("sqlobject_encoding")
- else:
- self.encoding = 'ascii'
+ del kw["sqlobject_encoding"]
+ deprecated("sqlobject_encoding is deprecated and no longer used.")
DBAPI.__init__(self, **kw)
def connectionFromURI(cls, uri):
@@ -79,12 +75,12 @@
if hasattr(conn, 'autocommit'):
conn.autocommit(bool(self.autoCommit))
- if self.dbEncoding:
+ if dbEncoding:
if hasattr(conn, 'set_character_set'): # MySQLdb 1.2.1 and later
- conn.set_character_set(self.dbEncoding)
+ conn.set_character_set(dbEncoding)
else: # pre MySQLdb 1.2.1
# works along with monkeypatching code above
- conn.query("SET NAMES %s" % self.dbEncoding)
+ conn.query("SET NAMES %s" % dbEncoding)
return conn
@@ -107,9 +103,6 @@
# done by calling ping(True) on the connection.
for count in range(3):
try:
- # For MySQLdb 1.2.1 and later, we go
- # encoding->unicode->charset (in the mysql db)
-
return cursor.execute(query)
except MySQLdb.OperationalError, e:
if e.args[0] in (MySQLdb.constants.CR.SERVER_GONE_ERROR, MySQLdb.constants.CR.SERVER_LOST):
|
|
From: <sub...@co...> - 2007-12-14 13:27:00
|
Author: phd
Date: 2007-12-14 06:26:54 -0700 (Fri, 14 Dec 2007)
New Revision: 3175
Modified:
SQLObject/branches/0.9/docs/News.txt
SQLObject/branches/0.9/sqlobject/mysql/mysqlconnection.py
Log:
MySQLConnection doesn't convert query strings to unicode (but allows to
pass unicode query strings if the user build ones). DB URI parameter
sqlobject_encoding is no longer used.
Modified: SQLObject/branches/0.9/docs/News.txt
===================================================================
--- SQLObject/branches/0.9/docs/News.txt 2007-12-14 13:26:40 UTC (rev 3174)
+++ SQLObject/branches/0.9/docs/News.txt 2007-12-14 13:26:54 UTC (rev 3175)
@@ -288,6 +288,10 @@
* With PySQLite2 do not use encode()/decode() from PySQLite1 - always use
base64 for BLOBs.
+* MySQLConnection doesn't convert query strings to unicode (but allows to
+ pass unicode query strings if the user build ones). DB URI parameter
+ sqlobject_encoding is no longer used.
+
SQLObject 0.7.9
===============
Modified: SQLObject/branches/0.9/sqlobject/mysql/mysqlconnection.py
===================================================================
--- SQLObject/branches/0.9/sqlobject/mysql/mysqlconnection.py 2007-12-14 13:26:40 UTC (rev 3174)
+++ SQLObject/branches/0.9/sqlobject/mysql/mysqlconnection.py 2007-12-14 13:26:54 UTC (rev 3175)
@@ -1,6 +1,7 @@
+from sqlobject import col
from sqlobject.dbconnection import DBAPI
from sqlobject.dberrors import *
-from sqlobject import col
+from sqlobject.main import deprecated
MySQLdb = None
class ErrorMessage(str):
@@ -28,10 +29,6 @@
self.user = user
self.password = password
self.kw = {}
- if MySQLdb.version_info[:3] >= (1, 2, 1):
- self.need_unicode = True
- else:
- self.need_unicode = False
for key in ("unix_socket", "init_command",
"read_default_file", "read_default_group", "conv"):
if key in kw:
@@ -45,9 +42,8 @@
else:
self.dbEncoding = None
if "sqlobject_encoding" in kw:
- self.encoding = col.popKey(kw, "sqlobject_encoding")
- else:
- self.encoding = 'ascii'
+ del kw["sqlobject_encoding"]
+ deprecated("sqlobject_encoding is deprecated and no longer used.")
DBAPI.__init__(self, **kw)
def connectionFromURI(cls, uri):
@@ -79,12 +75,12 @@
if hasattr(conn, 'autocommit'):
conn.autocommit(bool(self.autoCommit))
- if self.dbEncoding:
+ if dbEncoding:
if hasattr(conn, 'set_character_set'): # MySQLdb 1.2.1 and later
- conn.set_character_set(self.dbEncoding)
+ conn.set_character_set(dbEncoding)
else: # pre MySQLdb 1.2.1
# works along with monkeypatching code above
- conn.query("SET NAMES %s" % self.dbEncoding)
+ conn.query("SET NAMES %s" % dbEncoding)
return conn
@@ -107,13 +103,6 @@
# done by calling ping(True) on the connection.
for count in range(3):
try:
- # For MySQLdb 1.2.1 and later, we go
- # encoding->unicode->charset (in the mysql db)
- if self.need_unicode and not isinstance(query, unicode):
- try:
- query = unicode(query, self.encoding)
- except UnicodeError:
- pass
return cursor.execute(query)
except MySQLdb.OperationalError, e:
if e.args[0] in (MySQLdb.constants.CR.SERVER_GONE_ERROR, MySQLdb.constants.CR.SERVER_LOST):
@@ -223,10 +212,10 @@
if self.dbEncoding: kw['dbEncoding'] = self.dbEncoding
kw['name'] = soClass.sqlmeta.style.dbColumnToPythonAttr(field)
kw['dbName'] = field
-
+
# Since MySQL 5.0, 'NO' is returned in the NULL column (SQLObject expected '')
kw['notNone'] = (nullAllowed.upper() != 'YES' and True or False)
-
+
if default and t.startswith('int'):
kw['default'] = int(default)
elif default and t.startswith('float'):
|
|
From: <sub...@co...> - 2007-12-14 13:26:45
|
Author: phd
Date: 2007-12-14 06:26:40 -0700 (Fri, 14 Dec 2007)
New Revision: 3174
Modified:
SQLObject/branches/0.8/docs/News.txt
SQLObject/branches/0.8/sqlobject/mysql/mysqlconnection.py
Log:
MySQLConnection doesn't convert query strings to unicode (but allows to
pass unicode query strings if the user build ones). DB URI parameter
sqlobject_encoding is no longer used.
Modified: SQLObject/branches/0.8/docs/News.txt
===================================================================
--- SQLObject/branches/0.8/docs/News.txt 2007-12-14 13:26:07 UTC (rev 3173)
+++ SQLObject/branches/0.8/docs/News.txt 2007-12-14 13:26:40 UTC (rev 3174)
@@ -200,6 +200,10 @@
* With PySQLite2 do not use encode()/decode() from PySQLite1 - always use
base64 for BLOBs.
+* MySQLConnection doesn't convert query strings to unicode (but allows to
+ pass unicode query strings if the user build ones). DB URI parameter
+ sqlobject_encoding is no longer used.
+
SQLObject 0.7.9
===============
Modified: SQLObject/branches/0.8/sqlobject/mysql/mysqlconnection.py
===================================================================
--- SQLObject/branches/0.8/sqlobject/mysql/mysqlconnection.py 2007-12-14 13:26:07 UTC (rev 3173)
+++ SQLObject/branches/0.8/sqlobject/mysql/mysqlconnection.py 2007-12-14 13:26:40 UTC (rev 3174)
@@ -1,6 +1,7 @@
+from sqlobject import col
from sqlobject.dbconnection import DBAPI
from sqlobject.dberrors import *
-from sqlobject import col
+from sqlobject.main import deprecated
MySQLdb = None
class ErrorMessage(str):
@@ -28,10 +29,6 @@
self.user = user
self.password = password
self.kw = {}
- if MySQLdb.version_info[:3] >= (1, 2, 1):
- self.need_unicode = True
- else:
- self.need_unicode = False
for key in ("unix_socket", "init_command",
"read_default_file", "read_default_group"):
if key in kw:
@@ -45,9 +42,8 @@
else:
self.dbEncoding = None
if "sqlobject_encoding" in kw:
- self.encoding = col.popKey(kw, "sqlobject_encoding")
- else:
- self.encoding = 'ascii'
+ del kw["sqlobject_encoding"]
+ deprecated("sqlobject_encoding is deprecated and no longer used.")
DBAPI.__init__(self, **kw)
def connectionFromURI(cls, uri):
@@ -79,12 +75,12 @@
if hasattr(conn, 'autocommit'):
conn.autocommit(bool(self.autoCommit))
- if self.dbEncoding:
+ if dbEncoding:
if hasattr(conn, 'set_character_set'): # MySQLdb 1.2.1 and later
- conn.set_character_set(self.dbEncoding)
+ conn.set_character_set(dbEncoding)
else: # pre MySQLdb 1.2.1
# works along with monkeypatching code above
- conn.query("SET NAMES %s" % self.dbEncoding)
+ conn.query("SET NAMES %s" % dbEncoding)
return conn
@@ -107,13 +103,6 @@
# done by calling ping(True) on the connection.
for count in range(3):
try:
- # For MySQLdb 1.2.1 and later, we go
- # encoding->unicode->charset (in the mysql db)
- if self.need_unicode and not isinstance(query, unicode):
- try:
- query = unicode(query, self.encoding)
- except UnicodeError:
- pass
return cursor.execute(query)
except MySQLdb.OperationalError, e:
if e.args[0] in (MySQLdb.constants.CR.SERVER_GONE_ERROR, MySQLdb.constants.CR.SERVER_LOST):
@@ -225,10 +214,10 @@
if self.dbEncoding: kw['dbEncoding'] = self.dbEncoding
kw['name'] = soClass.sqlmeta.style.dbColumnToPythonAttr(field)
kw['dbName'] = field
-
+
# Since MySQL 5.0, 'NO' is returned in the NULL column (SQLObject expected '')
kw['notNone'] = (nullAllowed.upper() != 'YES' and True or False)
-
+
if default and t.startswith('int'):
kw['default'] = int(default)
elif default and t.startswith('float'):
|
|
From: <sub...@co...> - 2007-12-14 13:26:26
|
Author: phd
Date: 2007-12-14 06:26:07 -0700 (Fri, 14 Dec 2007)
New Revision: 3173
Modified:
SQLObject/branches/0.7/docs/News.txt
SQLObject/branches/0.7/sqlobject/mysql/mysqlconnection.py
Log:
MySQLConnection doesn't convert query strings to unicode (but allows to
pass unicode query strings if the user build ones). DB URI parameter
sqlobject_encoding is no longer used.
Modified: SQLObject/branches/0.7/docs/News.txt
===================================================================
--- SQLObject/branches/0.7/docs/News.txt 2007-12-13 07:12:44 UTC (rev 3172)
+++ SQLObject/branches/0.7/docs/News.txt 2007-12-14 13:26:07 UTC (rev 3173)
@@ -13,6 +13,10 @@
* With PySQLite2 do not use encode()/decode() from PySQLite1 - always use
base64 for BLOBs.
+* MySQLConnection doesn't convert query strings to unicode (but allows to
+ pass unicode query strings if the user build ones). DB URI parameter
+ sqlobject_encoding is no longer used.
+
SQLObject 0.7.9
===============
Modified: SQLObject/branches/0.7/sqlobject/mysql/mysqlconnection.py
===================================================================
--- SQLObject/branches/0.7/sqlobject/mysql/mysqlconnection.py 2007-12-13 07:12:44 UTC (rev 3172)
+++ SQLObject/branches/0.7/sqlobject/mysql/mysqlconnection.py 2007-12-14 13:26:07 UTC (rev 3173)
@@ -1,5 +1,6 @@
-from sqlobject.dbconnection import DBAPI
from sqlobject import col
+from sqlobject.dbconnection import DBAPI
+from sqlobject.main import deprecated
MySQLdb = None
class MySQLConnection(DBAPI):
@@ -11,7 +12,7 @@
def __init__(self, db, user, passwd='', host='localhost', port=None, **kw):
global MySQLdb
if MySQLdb is None:
- import MySQLdb, MySQLdb.constants.CR, MySQLdb.constants.ER
+ import MySQLdb
self.module = MySQLdb
self.host = host
self.port = port
@@ -19,10 +20,6 @@
self.user = user
self.password = passwd
self.kw = {}
- if MySQLdb.version_info[:3] >= (1, 2, 1):
- self.need_unicode = True
- else:
- self.need_unicode = False
for key in ("unix_socket", "init_command",
"read_default_file", "read_default_group"):
if key in kw:
@@ -36,9 +33,8 @@
else:
self.dbEncoding = None
if "sqlobject_encoding" in kw:
- self.encoding = col.popKey(kw, "sqlobject_encoding")
- else:
- self.encoding = 'ascii'
+ del kw["sqlobject_encoding"]
+ deprecated("sqlobject_encoding is deprecated and no longer used.")
DBAPI.__init__(self, **kw)
def connectionFromURI(cls, uri):
@@ -70,12 +66,12 @@
if hasattr(conn, 'autocommit'):
conn.autocommit(bool(self.autoCommit))
- if self.dbEncoding:
+ if dbEncoding:
if hasattr(conn, 'set_character_set'): # MySQLdb 1.2.1 and later
- conn.set_character_set(self.dbEncoding)
+ conn.set_character_set(dbEncoding)
else: # pre MySQLdb 1.2.1
# works along with monkeypatching code above
- conn.query("SET NAMES %s" % self.dbEncoding)
+ conn.query("SET NAMES %s" % dbEncoding)
return conn
@@ -86,13 +82,6 @@
def _executeRetry(self, conn, cursor, query):
while 1:
try:
- # For MySQLdb 1.2.1 and later, we go
- # encoding->unicode->charset (in the mysql db)
- if self.need_unicode and not isinstance(query, unicode):
- try:
- query = unicode(query, self.encoding)
- except UnicodeError:
- pass
return cursor.execute(query)
except MySQLdb.OperationalError, e:
if e.args[0] == 2013: # SERVER_LOST error
@@ -174,10 +163,10 @@
colClass = col.UnicodeCol
kw['name'] = soClass.sqlmeta.style.dbColumnToPythonAttr(field)
kw['dbName'] = field
-
+
# Since MySQL 5.0, 'NO' is returned in the NULL column (SQLObject expected '')
kw['notNone'] = (nullAllowed.upper() != 'YES' and True or False)
-
+
if default and t.startswith('int'):
kw['default'] = int(default)
elif default and t.startswith('float'):
|
|
From: <sub...@co...> - 2007-11-27 18:43:04
|
Author: phd Date: 2007-11-27 11:42:59 -0700 (Tue, 27 Nov 2007) New Revision: 3165 Modified: SQLObject/trunk/docs/Authors.txt Log: Added a new developer Dan Pascu. Modified: SQLObject/trunk/docs/Authors.txt =================================================================== --- SQLObject/trunk/docs/Authors.txt 2007-11-27 18:42:44 UTC (rev 3164) +++ SQLObject/trunk/docs/Authors.txt 2007-11-27 18:42:59 UTC (rev 3165) @@ -20,4 +20,5 @@ * J Paulo Fernandes Farias <jpaulofarias at gmail.com> * Shahms King <shahms at shahms.com> * David Turner, The Open Planning Project +* Dan Pascu <dan at ag-projects.com> * Oleg Broytmann <ph...@ph...> |
|
From: <sub...@co...> - 2007-11-27 18:42:48
|
Author: phd Date: 2007-11-27 11:42:44 -0700 (Tue, 27 Nov 2007) New Revision: 3164 Modified: SQLObject/branches/0.9/docs/Authors.txt Log: Added a new developer Dan Pascu. Modified: SQLObject/branches/0.9/docs/Authors.txt =================================================================== --- SQLObject/branches/0.9/docs/Authors.txt 2007-11-27 18:42:24 UTC (rev 3163) +++ SQLObject/branches/0.9/docs/Authors.txt 2007-11-27 18:42:44 UTC (rev 3164) @@ -20,4 +20,5 @@ * J Paulo Fernandes Farias <jpaulofarias at gmail.com> * Shahms King <shahms at shahms.com> * David Turner, The Open Planning Project +* Dan Pascu <dan at ag-projects.com> * Oleg Broytmann <ph...@ph...> |
|
From: <sub...@co...> - 2007-11-27 18:42:31
|
Author: phd Date: 2007-11-27 11:42:24 -0700 (Tue, 27 Nov 2007) New Revision: 3163 Modified: SQLObject/branches/0.8/docs/Authors.txt Log: Added a new developer Dan Pascu. Modified: SQLObject/branches/0.8/docs/Authors.txt =================================================================== --- SQLObject/branches/0.8/docs/Authors.txt 2007-11-27 18:41:51 UTC (rev 3162) +++ SQLObject/branches/0.8/docs/Authors.txt 2007-11-27 18:42:24 UTC (rev 3163) @@ -20,4 +20,5 @@ * J Paulo Fernandes Farias <jpaulofarias at gmail.com> * Shahms King <shahms at shahms.com> * David Turner, The Open Planning Project +* Dan Pascu <dan at ag-projects.com> * Oleg Broytmann <ph...@ph...> |
|
From: <sub...@co...> - 2007-11-27 18:41:54
|
Author: phd Date: 2007-11-27 11:41:51 -0700 (Tue, 27 Nov 2007) New Revision: 3162 Modified: SQLObject/branches/0.7/docs/Authors.txt Log: Added a new developer Dan Pascu. Modified: SQLObject/branches/0.7/docs/Authors.txt =================================================================== --- SQLObject/branches/0.7/docs/Authors.txt 2007-11-27 18:15:36 UTC (rev 3161) +++ SQLObject/branches/0.7/docs/Authors.txt 2007-11-27 18:41:51 UTC (rev 3162) @@ -17,4 +17,5 @@ * alexander smishlajev <alex at ank-sia.com> * Yaroslav Samchuk <yarcat at ank-sia.com> * Shahms King <shahms at shahms.com> +* Dan Pascu <dan at ag-projects.com> * Oleg Broytmann <phd at phd.pp.ru> |
|
From: <sub...@co...> - 2007-11-27 18:15:40
|
Author: phd
Date: 2007-11-27 11:15:36 -0700 (Tue, 27 Nov 2007)
New Revision: 3161
Modified:
SQLObject/trunk/docs/News.txt
SQLObject/trunk/sqlobject/sqlite/sqliteconnection.py
Log:
With PySQLite2 do not use encode()/decode() from PySQLite1 - always use base64 for BLOBs.
Modified: SQLObject/trunk/docs/News.txt
===================================================================
--- SQLObject/trunk/docs/News.txt 2007-11-27 18:15:21 UTC (rev 3160)
+++ SQLObject/trunk/docs/News.txt 2007-11-27 18:15:36 UTC (rev 3161)
@@ -53,6 +53,13 @@
* Changed the implementation type in BoolCol under SQLite from TINYINT to
BOOLEAN and made fromDatabase machinery to recognize it.
+* A number of changes ported from `SQLObject 0.7.10`_.
+
+SQLObject 0.9.3
+===============
+
+* A number of changes ported from `SQLObject 0.7.10`_.
+
SQLObject 0.9.2
===============
@@ -134,6 +141,11 @@
* idName can be inherited from the parent sqlmeta class.
+SQLObject 0.8.7
+===============
+
+* A number of changes ported from `SQLObject 0.7.10`_.
+
SQLObject 0.8.6
===============
@@ -312,6 +324,12 @@
* Fixed aggregators and accumulators with inheritance.
+SQLObject 0.7.10
+================
+
+* With PySQLite2 do not use encode()/decode() from PySQLite1 - always use
+ base64 for BLOBs.
+
SQLObject 0.7.9
===============
Modified: SQLObject/trunk/sqlobject/sqlite/sqliteconnection.py
===================================================================
--- SQLObject/trunk/sqlobject/sqlite/sqliteconnection.py 2007-11-27 18:15:21 UTC (rev 3160)
+++ SQLObject/trunk/sqlobject/sqlite/sqliteconnection.py 2007-11-27 18:15:36 UTC (rev 3161)
@@ -1,3 +1,4 @@
+import base64
from sqlobject.dbconnection import DBAPI
from sqlobject import col, sqlbuilder
from sqlobject.dberrors import *
@@ -35,6 +36,9 @@
except ImportError:
import sqlite
using_sqlite2 = False
+ if using_sqlite2:
+ sqlite.encode = base64.encodestring
+ sqlite.decode = base64.decodestring
self.module = sqlite
self.filename = filename # full path to sqlite-db-file
self._memory = filename == ':memory:'
@@ -54,15 +58,6 @@
for col_type in "text", "char", "varchar", "date", "time", "datetime", "timestamp":
sqlite.register_converter(col_type, stop_pysqlite2_converting_strings)
sqlite.register_converter(col_type.upper(), stop_pysqlite2_converting_strings)
- try:
- from sqlite import encode, decode
- except ImportError:
- import base64
- sqlite.encode = base64.encodestring
- sqlite.decode = base64.decodestring
- else:
- sqlite.encode = encode
- sqlite.decode = decode
global sqlite2_Binary
if sqlite2_Binary is None:
sqlite2_Binary = sqlite.Binary
|
|
From: <sub...@co...> - 2007-11-27 18:15:27
|
Author: phd
Date: 2007-11-27 11:15:21 -0700 (Tue, 27 Nov 2007)
New Revision: 3160
Modified:
SQLObject/branches/0.9/docs/News.txt
SQLObject/branches/0.9/sqlobject/sqlite/sqliteconnection.py
Log:
With PySQLite2 do not use encode()/decode() from PySQLite1 - always use base64 for BLOBs.
Modified: SQLObject/branches/0.9/docs/News.txt
===================================================================
--- SQLObject/branches/0.9/docs/News.txt 2007-11-27 18:14:56 UTC (rev 3159)
+++ SQLObject/branches/0.9/docs/News.txt 2007-11-27 18:15:21 UTC (rev 3160)
@@ -7,6 +7,11 @@
.. _start:
+SQLObject 0.9.3
+===============
+
+* A number of changes ported from `SQLObject 0.7.10`_.
+
SQLObject 0.9.2
===============
@@ -90,6 +95,11 @@
* idName can be inherited from the parent sqlmeta class.
+SQLObject 0.8.7
+===============
+
+* A number of changes ported from `SQLObject 0.7.10`_.
+
SQLObject 0.8.6
===============
@@ -272,6 +282,12 @@
* Fixed aggregators and accumulators with inheritance.
+SQLObject 0.7.10
+================
+
+* With PySQLite2 do not use encode()/decode() from PySQLite1 - always use
+ base64 for BLOBs.
+
SQLObject 0.7.9
===============
Modified: SQLObject/branches/0.9/sqlobject/sqlite/sqliteconnection.py
===================================================================
--- SQLObject/branches/0.9/sqlobject/sqlite/sqliteconnection.py 2007-11-27 18:14:56 UTC (rev 3159)
+++ SQLObject/branches/0.9/sqlobject/sqlite/sqliteconnection.py 2007-11-27 18:15:21 UTC (rev 3160)
@@ -1,3 +1,4 @@
+import base64
from sqlobject.dbconnection import DBAPI
from sqlobject.col import popKey
from sqlobject import col, sqlbuilder
@@ -36,6 +37,9 @@
except ImportError:
import sqlite
using_sqlite2 = False
+ if using_sqlite2:
+ sqlite.encode = base64.encodestring
+ sqlite.decode = base64.decodestring
self.module = sqlite
self.filename = filename # full path to sqlite-db-file
self._memory = filename == ':memory:'
@@ -55,15 +59,6 @@
for col_type in "text", "char", "varchar", "date", "time", "datetime", "timestamp":
sqlite.register_converter(col_type, stop_pysqlite2_converting_strings)
sqlite.register_converter(col_type.upper(), stop_pysqlite2_converting_strings)
- try:
- from sqlite import encode, decode
- except ImportError:
- import base64
- sqlite.encode = base64.encodestring
- sqlite.decode = base64.decodestring
- else:
- sqlite.encode = encode
- sqlite.decode = decode
global sqlite2_Binary
if sqlite2_Binary is None:
sqlite2_Binary = sqlite.Binary
|
|
From: <sub...@co...> - 2007-11-27 18:14:59
|
Author: phd
Date: 2007-11-27 11:14:56 -0700 (Tue, 27 Nov 2007)
New Revision: 3159
Modified:
SQLObject/branches/0.8/docs/News.txt
SQLObject/branches/0.8/sqlobject/sqlite/sqliteconnection.py
Log:
With PySQLite2 do not use encode()/decode() from PySQLite1 - always use base64 for BLOBs.
Modified: SQLObject/branches/0.8/docs/News.txt
===================================================================
--- SQLObject/branches/0.8/docs/News.txt 2007-11-27 18:13:38 UTC (rev 3158)
+++ SQLObject/branches/0.8/docs/News.txt 2007-11-27 18:14:56 UTC (rev 3159)
@@ -7,6 +7,11 @@
.. _start:
+SQLObject 0.8.7
+===============
+
+* A number of changes ported from `SQLObject 0.7.10`_.
+
SQLObject 0.8.6
===============
@@ -189,6 +194,12 @@
* Fixed aggregators and accumulators with inheritance.
+SQLObject 0.7.10
+================
+
+* With PySQLite2 do not use encode()/decode() from PySQLite1 - always use
+ base64 for BLOBs.
+
SQLObject 0.7.9
===============
Modified: SQLObject/branches/0.8/sqlobject/sqlite/sqliteconnection.py
===================================================================
--- SQLObject/branches/0.8/sqlobject/sqlite/sqliteconnection.py 2007-11-27 18:13:38 UTC (rev 3158)
+++ SQLObject/branches/0.8/sqlobject/sqlite/sqliteconnection.py 2007-11-27 18:14:56 UTC (rev 3159)
@@ -1,3 +1,4 @@
+import base64
from sqlobject.dbconnection import DBAPI
from sqlobject.col import popKey
from sqlobject.dberrors import *
@@ -35,6 +36,9 @@
except ImportError:
import sqlite
using_sqlite2 = False
+ if using_sqlite2:
+ sqlite.encode = base64.encodestring
+ sqlite.decode = base64.decodestring
self.module = sqlite
self.filename = filename # full path to sqlite-db-file
self._memory = filename == ':memory:'
@@ -54,15 +58,6 @@
for col_type in "text", "char", "varchar", "date", "time", "datetime", "timestamp":
sqlite.register_converter(col_type, stop_pysqlite2_converting_strings)
sqlite.register_converter(col_type.upper(), stop_pysqlite2_converting_strings)
- try:
- from sqlite import encode, decode
- except ImportError:
- import base64
- sqlite.encode = base64.encodestring
- sqlite.decode = base64.decodestring
- else:
- sqlite.encode = encode
- sqlite.decode = decode
global sqlite2_Binary
if sqlite2_Binary is None:
sqlite2_Binary = sqlite.Binary
|
|
From: <sub...@co...> - 2007-11-27 18:13:44
|
Author: phd
Date: 2007-11-27 11:13:38 -0700 (Tue, 27 Nov 2007)
New Revision: 3158
Modified:
SQLObject/branches/0.7/docs/News.txt
SQLObject/branches/0.7/sqlobject/sqlite/sqliteconnection.py
Log:
With PySQLite2 do not use encode()/decode() from PySQLite1 - always use base64 for BLOBs.
Modified: SQLObject/branches/0.7/docs/News.txt
===================================================================
--- SQLObject/branches/0.7/docs/News.txt 2007-11-20 17:52:04 UTC (rev 3157)
+++ SQLObject/branches/0.7/docs/News.txt 2007-11-27 18:13:38 UTC (rev 3158)
@@ -7,6 +7,12 @@
.. _start:
+SQLObject 0.7.10
+================
+
+* With PySQLite2 do not use encode()/decode() from PySQLite1 - always use
+ base64 for BLOBs.
+
SQLObject 0.7.9
===============
Modified: SQLObject/branches/0.7/sqlobject/sqlite/sqliteconnection.py
===================================================================
--- SQLObject/branches/0.7/sqlobject/sqlite/sqliteconnection.py 2007-11-20 17:52:04 UTC (rev 3157)
+++ SQLObject/branches/0.7/sqlobject/sqlite/sqliteconnection.py 2007-11-27 18:13:38 UTC (rev 3158)
@@ -1,3 +1,4 @@
+import base64
from sqlobject.dbconnection import DBAPI
from sqlobject.col import popKey
import thread
@@ -18,6 +19,8 @@
if sqlite is None:
try:
from pysqlite2 import dbapi2 as sqlite
+ sqlite.encode = base64.encodestring
+ sqlite.decode = base64.decodestring
using_sqlite2 = True
except ImportError:
import sqlite
@@ -41,15 +44,6 @@
for col_type in "text", "char", "varchar", "date", "time", "datetime", "timestamp":
sqlite.register_converter(col_type, stop_pysqlite2_converting_strings)
sqlite.register_converter(col_type.upper(), stop_pysqlite2_converting_strings)
- try:
- from sqlite import encode, decode
- except ImportError:
- import base64
- sqlite.encode = base64.encodestring
- sqlite.decode = base64.decodestring
- else:
- sqlite.encode = encode
- sqlite.decode = decode
global sqlite2_Binary
if sqlite2_Binary is None:
sqlite2_Binary = sqlite.Binary
|
|
From: SourceForge.net <no...@so...> - 2007-11-27 17:33:51
|
Bugs item #1839646, was opened at 2007-11-27 17: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=1839646&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: Peter Russell (psr) Assigned to: Nobody/Anonymous (nobody) Summary: SQLObject instances of same class with same ID should be == Initial Comment: I've got a failing unittest in some code where I assert that: group in member.groups where Group and Member are InheritableSQLObject classes, related by a RelatedJoin. The test loads group and member, then calls the "add a member to a group" controller of my web app, to add the member to the group. The assertion fails despite the controller working correctly, because SQLObject doesn't override __eq__ to ensure that two different python instances pointing at the same row are equal. Presumably adding the following to the definition of SQLObject would work def __eq__(self, other): if self.__class__ == other.__class__: if self.id == other.id: return True return False This is occuring with an SQLite in-memory database, with SQLObject 0.7.7 (I know I should upgrade!) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1839646&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2007-11-04 18:25:22
|
Bugs item #1825466, was opened at 2007-11-04 06:21 Message generated for change (Comment added) made by igor_aguiar You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1825466&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: Firebird/Interbase Group: SQLObject release (specify) Status: Open Resolution: None Priority: 5 Private: No Submitted By: Igor Aguiar (igor_aguiar) Assigned to: Nobody/Anonymous (nobody) Summary: Reserved words as table/column name in Firebird Initial Comment: Hi, first of all I would like to thank you guys for this amazing software. I'm pretty new to Python and I was playing with SQLObject using the IDLE IDE, when I tried to run the following code: #--- START OF CODE from sqlobject import * from sqlobject.inheritance import InheritableSQLObject con = connectionForURI('firebird://SYSDBA:masterkey@localhost//var/lib/firebird2/data/sqlobj.fdb') sqlhub.processConnection = con class Person(InheritableSQLObject): firstName = StringCol(length=100, notNone=True) middleInitial = StringCol(length = 1, default = None) lastName = StringCol(length=100, notNone=True) class User(Person): login = StringCol(length=20, notNone=True, unique=True) password = StringCol(length=20, notNone=True) Person.createTable() User.createTable() #--- END OF CODE But a error occurs when the "User.createTable()" is performed. Below is the error: #--- START OF ERROR Traceback (most recent call last): File "<pyshell#21>", line 1, in <module> User.createTable() File "/usr/lib/python2.5/site-packages/SQLObject-0.9.2-py2.5.egg/sqlobject/main.py", line 1378, in createTable constraints = conn.createTable(cls) File "/usr/lib/python2.5/site-packages/SQLObject-0.9.2-py2.5.egg/sqlobject/firebird/firebirdconnection.py", line 128, in createTable (soClass.sqlmeta.table, self.createColumns(soClass))) File "/usr/lib/python2.5/site-packages/SQLObject-0.9.2-py2.5.egg/sqlobject/dbconnection.py", line 342, in query return self._runWithConnection(self._query, s) File "/usr/lib/python2.5/site-packages/SQLObject-0.9.2-py2.5.egg/sqlobject/firebird/firebirdconnection.py", line 59, in _runWithConnection val = meth(conn, *args) File "/usr/lib/python2.5/site-packages/SQLObject-0.9.2-py2.5.egg/sqlobject/dbconnection.py", line 339, in _query self._executeRetry(conn, conn.cursor(), s) File "/usr/lib/python2.5/site-packages/SQLObject-0.9.2-py2.5.egg/sqlobject/dbconnection.py", line 334, in _executeRetry return cursor.execute(query) File "/var/lib/python-support/python2.5/kinterbasdb/__init__.py", line 1594, in execute self.description = _k.execute(self._C_cursor, sql, params) ProgrammingError: (-104, 'isc_dsql_prepare: Dynamic SQL Error. SQL error code = -104. Token unknown - line 1, char 14. user. ') #--- END OF ERROR Looking at the IDLE's Stack Viewer, I noticed that the SQL command generated to create the User table was something like this: 'CREATE TABLE user (\n id INT NOT NULL PRIMAR...AR(20) NOT NULL,\n child_name VARCHAR(255)\n)' The problem, as you probably already noticed, is that USER is a reserved word, and Firebird won't let a table with this name be created. Maybe surrounding the table's name with quotes would be a solution. This is my configuration: Ubuntu 7.04, python 2.5, SQLObject 0.9.2 and FirebirdSQL 1.5.3.4870 super server. Best regards, Igor ---------------------------------------------------------------------- >Comment By: Igor Aguiar (igor_aguiar) Date: 2007-11-04 16:25 Message: Logged In: YES user_id=1929062 Originator: YES Or "sqlmeta" can be used :) I guess I posted too early... ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1825466&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2007-11-04 09:21:18
|
Bugs item #1825466, was opened at 2007-11-04 06:21 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=1825466&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: Firebird/Interbase Group: SQLObject release (specify) Status: Open Resolution: None Priority: 5 Private: No Submitted By: Igor Aguiar (igor_aguiar) Assigned to: Nobody/Anonymous (nobody) Summary: Reserved words as table/column name in Firebird Initial Comment: Hi, first of all I would like to thank you guys for this amazing software. I'm pretty new to Python and I was playing with SQLObject using the IDLE IDE, when I tried to run the following code: #--- START OF CODE from sqlobject import * from sqlobject.inheritance import InheritableSQLObject con = connectionForURI('firebird://SYSDBA:masterkey@localhost//var/lib/firebird2/data/sqlobj.fdb') sqlhub.processConnection = con class Person(InheritableSQLObject): firstName = StringCol(length=100, notNone=True) middleInitial = StringCol(length = 1, default = None) lastName = StringCol(length=100, notNone=True) class User(Person): login = StringCol(length=20, notNone=True, unique=True) password = StringCol(length=20, notNone=True) Person.createTable() User.createTable() #--- END OF CODE But a error occurs when the "User.createTable()" is performed. Below is the error: #--- START OF ERROR Traceback (most recent call last): File "<pyshell#21>", line 1, in <module> User.createTable() File "/usr/lib/python2.5/site-packages/SQLObject-0.9.2-py2.5.egg/sqlobject/main.py", line 1378, in createTable constraints = conn.createTable(cls) File "/usr/lib/python2.5/site-packages/SQLObject-0.9.2-py2.5.egg/sqlobject/firebird/firebirdconnection.py", line 128, in createTable (soClass.sqlmeta.table, self.createColumns(soClass))) File "/usr/lib/python2.5/site-packages/SQLObject-0.9.2-py2.5.egg/sqlobject/dbconnection.py", line 342, in query return self._runWithConnection(self._query, s) File "/usr/lib/python2.5/site-packages/SQLObject-0.9.2-py2.5.egg/sqlobject/firebird/firebirdconnection.py", line 59, in _runWithConnection val = meth(conn, *args) File "/usr/lib/python2.5/site-packages/SQLObject-0.9.2-py2.5.egg/sqlobject/dbconnection.py", line 339, in _query self._executeRetry(conn, conn.cursor(), s) File "/usr/lib/python2.5/site-packages/SQLObject-0.9.2-py2.5.egg/sqlobject/dbconnection.py", line 334, in _executeRetry return cursor.execute(query) File "/var/lib/python-support/python2.5/kinterbasdb/__init__.py", line 1594, in execute self.description = _k.execute(self._C_cursor, sql, params) ProgrammingError: (-104, 'isc_dsql_prepare: Dynamic SQL Error. SQL error code = -104. Token unknown - line 1, char 14. user. ') #--- END OF ERROR Looking at the IDLE's Stack Viewer, I noticed that the SQL command generated to create the User table was something like this: 'CREATE TABLE user (\n id INT NOT NULL PRIMAR...AR(20) NOT NULL,\n child_name VARCHAR(255)\n)' The problem, as you probably already noticed, is that USER is a reserved word, and Firebird won't let a table with this name be created. Maybe surrounding the table's name with quotes would be a solution. This is my configuration: Ubuntu 7.04, python 2.5, SQLObject 0.9.2 and FirebirdSQL 1.5.3.4870 super server. Best regards, Igor ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1825466&group_id=74338 |