sqlobject-cvs Mailing List for SQLObject (Page 33)
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...> - 2012-01-09 12:49:54
|
Bugs item #3471315, was opened at 2012-01-09 04:49 Message generated for change (Tracker Item Submitted) made by hthompson You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=3471315&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: Postgres Group: SQLObject release (specify) Status: Open Resolution: None Priority: 5 Private: No Submitted By: Henry S Thompson (hthompson) Assigned to: Nobody/Anonymous (nobody) Summary: Can't use VIEWs with postgres Initial Comment: SQLObject v.1.2.1, Python 2.6, Windows 7 x64, Postgresql 9.1 The code in pgconnection.py for finding primary keys won't ever find anything for a VIEW. Not sure what the correct fix is (I don't understand postgres internals v. well), but the attached patch works for me. . . ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=3471315&group_id=74338 |
|
From: <sub...@co...> - 2011-12-14 17:44:17
|
Author: phd
Date: Wed Dec 14 10:44:09 2011
New Revision: 4496
Log:
No need to increase self._connectionCount - DBAPI.getConnection will do it.
Modified:
SQLObject/trunk/sqlobject/postgres/pgconnection.py
Modified: SQLObject/trunk/sqlobject/postgres/pgconnection.py
==============================================================================
--- SQLObject/trunk/sqlobject/postgres/pgconnection.py Wed Dec 14 10:32:43 2011 (r4495)
+++ SQLObject/trunk/sqlobject/postgres/pgconnection.py Wed Dec 14 10:44:09 2011 (r4496)
@@ -143,7 +143,6 @@
# For printDebug in _executeRetry
self._connectionNumbers[id(conn)] = self._connectionCount
- self._connectionCount += 1
if self.autoCommit: self._setAutoCommit(conn, 1)
c = conn.cursor()
|
|
From: <sub...@co...> - 2011-12-14 17:32:50
|
Author: phd
Date: Wed Dec 14 10:32:43 2011
New Revision: 4495
Log:
Set self._connectionNumbers for printDebug in _executeRetry.
Modified:
SQLObject/trunk/sqlobject/postgres/pgconnection.py
Modified: SQLObject/trunk/sqlobject/postgres/pgconnection.py
==============================================================================
--- SQLObject/trunk/sqlobject/postgres/pgconnection.py Wed Dec 14 10:12:28 2011 (r4494)
+++ SQLObject/trunk/sqlobject/postgres/pgconnection.py Wed Dec 14 10:32:43 2011 (r4495)
@@ -140,6 +140,11 @@
conn = self.module.connect(**self.dsn_dict)
except self.module.OperationalError, e:
raise OperationalError("%s; used connection string %r" % (e, self.dsn))
+
+ # For printDebug in _executeRetry
+ self._connectionNumbers[id(conn)] = self._connectionCount
+ self._connectionCount += 1
+
if self.autoCommit: self._setAutoCommit(conn, 1)
c = conn.cursor()
if self.schema:
|
|
From: <sub...@co...> - 2011-12-14 17:12:35
|
Author: phd
Date: Wed Dec 14 10:12:28 2011
New Revision: 4494
Log:
Translate OperationalError in makeConnection.
Modified:
SQLObject/trunk/sqlobject/postgres/pgconnection.py
Modified: SQLObject/trunk/sqlobject/postgres/pgconnection.py
==============================================================================
--- SQLObject/trunk/sqlobject/postgres/pgconnection.py Wed Dec 14 09:38:42 2011 (r4493)
+++ SQLObject/trunk/sqlobject/postgres/pgconnection.py Wed Dec 14 10:12:28 2011 (r4494)
@@ -139,7 +139,7 @@
else:
conn = self.module.connect(**self.dsn_dict)
except self.module.OperationalError, e:
- raise self.module.OperationalError("%s; used connection string %r" % (e, self.dsn))
+ raise OperationalError("%s; used connection string %r" % (e, self.dsn))
if self.autoCommit: self._setAutoCommit(conn, 1)
c = conn.cursor()
if self.schema:
|
|
From: SourceForge.net <no...@so...> - 2011-12-14 16:38:08
|
Bugs item #2870763, was opened at 2009-09-30 07:08 Message generated for change (Settings changed) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=2870763&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: Postgres Group: None >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) >Assigned to: Oleg Broytman (phd) Summary: SQLObject doesn't handle psycopg2.IntegrityError Initial Comment: SQLObject throws psycopg2.IntegrityError (duplicate key value violates unique constraint "account_username_key") when in fact it should throw sqlobject.dberrors.IntegrityError. try: person = Account(username="rafael", password="senha", connection=conn) person.addContact(Contact(email="ro...@ma...", connection=conn)) person.addContact(Contact(email="ma...@ma...", connection=conn)) except sqlobject.dberrors.IntegrityError, e: pass ---------------------------------------------------------------------- >Comment By: Oleg Broytman (phd) Date: 2011-12-14 08:38 Message: Implemented in commit 4492. ---------------------------------------------------------------------- Comment By: Oleg Broytman (phd) Date: 2009-10-12 08:39 Message: Only SQLiteConnection and MySQLConnection currently map DB API exceptions to sqlobject.dberrors. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=2870763&group_id=74338 |
|
From: <sub...@co...> - 2011-12-14 16:35:23
|
Author: phd
Date: Wed Dec 14 09:35:13 2011
New Revision: 4492
Log:
PostgresConnection performs translation of exceptions
to standard SQLObject's hierarchy of exceptions.
Modified:
SQLObject/trunk/docs/News.txt
SQLObject/trunk/sqlobject/postgres/pgconnection.py
SQLObject/trunk/sqlobject/tests/dbtest.py
Modified: SQLObject/trunk/docs/News.txt
==============================================================================
--- SQLObject/trunk/docs/News.txt Sun Dec 4 07:32:41 2011 (r4491)
+++ SQLObject/trunk/docs/News.txt Wed Dec 14 09:35:13 2011 (r4492)
@@ -10,6 +10,12 @@
SQLObject (trunk)
=================
+Features & Interface
+--------------------
+
+* PostgresConnection performs translation of exceptions to standard
+ SQLObject's hierarchy of exceptions.
+
SQLObject 1.2.1
===============
Modified: SQLObject/trunk/sqlobject/postgres/pgconnection.py
==============================================================================
--- SQLObject/trunk/sqlobject/postgres/pgconnection.py Sun Dec 4 07:32:41 2011 (r4491)
+++ SQLObject/trunk/sqlobject/postgres/pgconnection.py Wed Dec 14 09:35:13 2011 (r4492)
@@ -3,6 +3,15 @@
from sqlobject import col
from sqlobject import sqlbuilder
from sqlobject.converters import registerConverter
+from sqlobject.dberrors import *
+
+class ErrorMessage(str):
+ def __new__(cls, e):
+ obj = str.__new__(cls, e[0])
+ obj.code = None
+ obj.module = e.__module__
+ obj.exception = e.__class__.__name__
+ return obj
class PostgresConnection(DBAPI):
@@ -134,12 +143,42 @@
if self.autoCommit: self._setAutoCommit(conn, 1)
c = conn.cursor()
if self.schema:
- c.execute("SET search_path TO " + self.schema)
+ self._executeRetry(conn, c, "SET search_path TO " + self.schema)
dbEncoding = self.dbEncoding
if dbEncoding:
- c.execute("SET client_encoding TO '%s'" % dbEncoding)
+ self._executeRetry(conn, c, "SET client_encoding TO '%s'" % dbEncoding)
return conn
+ def _executeRetry(self, conn, cursor, query):
+ if self.debug:
+ self.printDebug(conn, query, 'QueryR')
+ try:
+ return cursor.execute(query)
+ except self.module.OperationalError, e:
+ raise OperationalError(ErrorMessage(e))
+ except self.module.IntegrityError, e:
+ msg = ErrorMessage(e)
+ if e.pgcode == '23505':
+ raise DuplicateEntryError(msg)
+ else:
+ raise IntegrityError(msg)
+ except self.module.InternalError, e:
+ raise InternalError(ErrorMessage(e))
+ except self.module.ProgrammingError, e:
+ raise ProgrammingError(ErrorMessage(e))
+ except self.module.DataError, e:
+ raise DataError(ErrorMessage(e))
+ except self.module.NotSupportedError, e:
+ raise NotSupportedError(ErrorMessage(e))
+ except self.module.DatabaseError, e:
+ raise DatabaseError(ErrorMessage(e))
+ except self.module.InterfaceError, e:
+ raise InterfaceError(ErrorMessage(e))
+ except self.module.Warning, e:
+ raise Warning(ErrorMessage(e))
+ except self.module.Error, e:
+ raise Error(ErrorMessage(e))
+
def _queryInsertID(self, conn, soInstance, id, names, values):
table = soInstance.sqlmeta.table
idName = soInstance.sqlmeta.idName
@@ -147,14 +186,14 @@
'%s_%s_seq' % (table, idName)
c = conn.cursor()
if id is None:
- c.execute("SELECT NEXTVAL('%s')" % sequenceName)
+ self._executeRetry(conn, c, "SELECT NEXTVAL('%s')" % sequenceName)
id = c.fetchone()[0]
names = [idName] + names
values = [id] + values
q = self._insertSQL(table, names, values)
if self.debug:
self.printDebug(conn, q, 'QueryIns')
- c.execute(q)
+ self._executeRetry(conn, c, q)
if self.debugOutput:
self.printDebug(conn, id, 'QueryIns', 'result')
return id
@@ -341,8 +380,8 @@
cur = conn.cursor()
# We must close the transaction with a commit so that
# the CREATE DATABASE can work (which can't be in a transaction):
- cur.execute('COMMIT')
- cur.execute('%s DATABASE %s' % (op, self.db))
+ self._executeRetry(conn, cur, 'COMMIT')
+ self._executeRetry(conn, cur, '%s DATABASE %s' % (op, self.db))
cur.close()
conn.close()
Modified: SQLObject/trunk/sqlobject/tests/dbtest.py
==============================================================================
--- SQLObject/trunk/sqlobject/tests/dbtest.py Sun Dec 4 07:32:41 2011 (r4491)
+++ SQLObject/trunk/sqlobject/tests/dbtest.py Wed Dec 14 09:35:13 2011 (r4492)
@@ -38,7 +38,7 @@
return
"""
supportsMatrix = {
- '+exceptions': 'mysql sqlite',
+ '+exceptions': 'mysql postgres sqlite',
'-transactions': 'mysql rdbhost',
'-dropTableCascade': 'sybase mssql',
'-expressionIndex': 'mysql sqlite firebird mssql',
|
|
From: <sub...@co...> - 2011-12-04 14:32:47
|
Author: phd Date: Sun Dec 4 07:32:41 2011 New Revision: 4491 Log: Stable version 1.2.1. Modified: SQLObject/tags/1.2.1/README.txt SQLObject/tags/1.2.1/setup.cfg SQLObject/tags/1.2.1/sqlobject/__version__.py Modified: SQLObject/tags/1.2.1/README.txt ============================================================================== --- SQLObject/tags/1.2.1/README.txt Sun Dec 4 07:31:45 2011 (r4490) +++ SQLObject/tags/1.2.1/README.txt Sun Dec 4 07:32:41 2011 (r4491) @@ -1,5 +1,5 @@ -SQLObject 1.2 -============= +SQLObject 1.2.1 +=============== Thanks for looking at SQLObject. SQLObject is an object-relational mapper, i.e., a library that will wrap your database tables in Python Modified: SQLObject/tags/1.2.1/setup.cfg ============================================================================== --- SQLObject/tags/1.2.1/setup.cfg Sun Dec 4 07:31:45 2011 (r4490) +++ SQLObject/tags/1.2.1/setup.cfg Sun Dec 4 07:32:41 2011 (r4491) @@ -5,10 +5,6 @@ [easy_install] #find_links = http://svn.pythonpaste.org/package_index.html -[egg_info] -tag_build = dev -tag_svn_revision = true - [pudge] theme = pythonpaste.org docs = docs/index.txt docs/Authors.txt docs/DeveloperGuide.txt docs/FAQ.txt Modified: SQLObject/tags/1.2.1/sqlobject/__version__.py ============================================================================== --- SQLObject/tags/1.2.1/sqlobject/__version__.py Sun Dec 4 07:31:45 2011 (r4490) +++ SQLObject/tags/1.2.1/sqlobject/__version__.py Sun Dec 4 07:32:41 2011 (r4491) @@ -1,8 +1,8 @@ -version = '1.2' +version = '1.2.1' major = 1 minor = 2 -micro = 0 -release_level = 'branch' +micro = 1 +release_level = 'final' serial = 0 version_info = (major, minor, micro, release_level, serial) |
|
From: <sub...@co...> - 2011-12-04 14:31:51
|
Author: phd
Date: Sun Dec 4 07:31:45 2011
New Revision: 4490
Log:
Tagging 1.2.1
Added:
SQLObject/tags/1.2.1/
- copied from r4489, SQLObject/branches/1.2/
|
|
From: <sub...@co...> - 2011-12-04 14:30:11
|
Author: phd Date: Sun Dec 4 07:30:04 2011 New Revision: 4489 Log: Stable version 1.1.4. Modified: SQLObject/tags/1.1.4/README.txt SQLObject/tags/1.1.4/setup.cfg SQLObject/tags/1.1.4/sqlobject/__version__.py Modified: SQLObject/tags/1.1.4/README.txt ============================================================================== --- SQLObject/tags/1.1.4/README.txt Sun Dec 4 07:28:16 2011 (r4488) +++ SQLObject/tags/1.1.4/README.txt Sun Dec 4 07:30:04 2011 (r4489) @@ -1,5 +1,5 @@ -SQLObject 1.1 -============= +SQLObject 1.1.4 +=============== Thanks for looking at SQLObject. SQLObject is an object-relational mapper, i.e., a library that will wrap your database tables in Python Modified: SQLObject/tags/1.1.4/setup.cfg ============================================================================== --- SQLObject/tags/1.1.4/setup.cfg Sun Dec 4 07:28:16 2011 (r4488) +++ SQLObject/tags/1.1.4/setup.cfg Sun Dec 4 07:30:04 2011 (r4489) @@ -5,10 +5,6 @@ [easy_install] #find_links = http://svn.pythonpaste.org/package_index.html -[egg_info] -tag_build = dev -tag_svn_revision = true - [pudge] theme = pythonpaste.org docs = docs/index.txt docs/Authors.txt docs/DeveloperGuide.txt docs/FAQ.txt Modified: SQLObject/tags/1.1.4/sqlobject/__version__.py ============================================================================== --- SQLObject/tags/1.1.4/sqlobject/__version__.py Sun Dec 4 07:28:16 2011 (r4488) +++ SQLObject/tags/1.1.4/sqlobject/__version__.py Sun Dec 4 07:30:04 2011 (r4489) @@ -1,8 +1,8 @@ -version = '1.1' +version = '1.1.4' major = 1 minor = 1 -micro = 0 -release_level = 'branch' +micro = 4 +release_level = 'final' serial = 0 version_info = (major, minor, micro, release_level, serial) |
|
From: <sub...@co...> - 2011-12-04 14:28:22
|
Author: phd
Date: Sun Dec 4 07:28:16 2011
New Revision: 4488
Log:
Tagging 1.1.4
Added:
SQLObject/tags/1.1.4/
- copied from r4487, SQLObject/branches/1.1/
|
|
From: <sub...@co...> - 2011-12-04 14:26:41
|
Author: phd Date: Sun Dec 4 07:26:35 2011 New Revision: 4487 Log: Going to release SQLObject 1.1.4 and 1.2.1. Modified: SQLObject/trunk/docs/News.txt Modified: SQLObject/trunk/docs/News.txt ============================================================================== --- SQLObject/trunk/docs/News.txt Sun Dec 4 07:25:30 2011 (r4486) +++ SQLObject/trunk/docs/News.txt Sun Dec 4 07:26:35 2011 (r4487) @@ -13,6 +13,8 @@ SQLObject 1.2.1 =============== +Released 4 Dec 2011. + * A bugfix was ported from `SQLObject 1.1.4`_. SQLObject 1.2.0 @@ -48,6 +50,8 @@ SQLObject 1.1.4 =============== +Released 4 Dec 2011. + * A bug was fixed in handling ``modulo`` operator - SQLite implements only ``%``, MySQL - only ``MOD()``, PostgreSQL implements both. |
|
From: <sub...@co...> - 2011-12-04 14:25:36
|
Author: phd Date: Sun Dec 4 07:25:30 2011 New Revision: 4486 Log: Going to release SQLObject 1.1.4 and 1.2.1. Modified: SQLObject/branches/1.2/docs/News.txt Modified: SQLObject/branches/1.2/docs/News.txt ============================================================================== --- SQLObject/branches/1.2/docs/News.txt Sun Dec 4 07:23:50 2011 (r4485) +++ SQLObject/branches/1.2/docs/News.txt Sun Dec 4 07:25:30 2011 (r4486) @@ -10,6 +10,8 @@ SQLObject 1.2.1 =============== +Released 4 Dec 2011. + * A bugfix was ported from `SQLObject 1.1.4`_. SQLObject 1.2.0 @@ -45,6 +47,8 @@ SQLObject 1.1.4 =============== +Released 4 Dec 2011. + * A bug was fixed in handling ``modulo`` operator - SQLite implements only ``%``, MySQL - only ``MOD()``, PostgreSQL implements both. |
|
From: <sub...@co...> - 2011-12-04 14:23:59
|
Author: phd Date: Sun Dec 4 07:23:50 2011 New Revision: 4485 Log: Going to release SQLObject 1.1.4. Modified: SQLObject/branches/1.1/docs/News.txt Modified: SQLObject/branches/1.1/docs/News.txt ============================================================================== --- SQLObject/branches/1.1/docs/News.txt Sat Nov 26 06:12:03 2011 (r4484) +++ SQLObject/branches/1.1/docs/News.txt Sun Dec 4 07:23:50 2011 (r4485) @@ -10,6 +10,8 @@ SQLObject 1.1.4 =============== +Released 4 Dec 2011. + * A bug was fixed in handling ``modulo`` operator - SQLite implements only ``%``, MySQL - only ``MOD()``, PostgreSQL implements both. |
|
From: SourceForge.net <no...@so...> - 2011-11-26 13:28:07
|
Bugs item #3442071, was opened at 2011-11-25 07:35 Message generated for change (Comment added) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=3442071&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: Tobias (vanity) >Assigned to: Oleg Broytman (phd) Summary: Modulo mapped to function instead of operator Initial Comment: With SQLObject 1.2.0 and whatever SQLite comes with Python 2.6, this following works fine: Video.select("""video.width % 2 == 1""")[0] But this raises sqlobject.dberrors.OperationalError: no such function: MOD: Video.select(Video.q.width % 2 == 1)[0] ---------------------------------------------------------------------- >Comment By: Oleg Broytman (phd) Date: 2011-11-26 05:28 Message: Fixed in commits 4482:4484 (branches 1.1, 1.2 and the trunk). Will be in the next releases. Thank you! ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=3442071&group_id=74338 |
|
From: <sub...@co...> - 2011-11-26 13:12:09
|
Author: phd
Date: Sat Nov 26 06:12:03 2011
New Revision: 4484
Log:
Merged revision 4483 from branch 1.2: a bug was fixed in handling ``modulo`` operator.
Modified:
SQLObject/trunk/docs/News.txt
SQLObject/trunk/sqlobject/sqlbuilder.py
SQLObject/trunk/sqlobject/tests/test_sqlbuilder.py
Modified: SQLObject/trunk/docs/News.txt
==============================================================================
--- SQLObject/trunk/docs/News.txt Sat Nov 26 06:09:55 2011 (r4483)
+++ SQLObject/trunk/docs/News.txt Sat Nov 26 06:12:03 2011 (r4484)
@@ -10,6 +10,11 @@
SQLObject (trunk)
=================
+SQLObject 1.2.1
+===============
+
+* A bugfix was ported from `SQLObject 1.1.4`_.
+
SQLObject 1.2.0
===============
@@ -40,6 +45,12 @@
* sqlobject.__doc__ and main.__doc__ no longer contain version number.
Use sqlobject.version or version_info.
+SQLObject 1.1.4
+===============
+
+* A bug was fixed in handling ``modulo`` operator - SQLite implements
+ only ``%``, MySQL - only ``MOD()``, PostgreSQL implements both.
+
SQLObject 1.1.3
===============
Modified: SQLObject/trunk/sqlobject/sqlbuilder.py
==============================================================================
--- SQLObject/trunk/sqlobject/sqlbuilder.py Sat Nov 26 06:09:55 2011 (r4483)
+++ SQLObject/trunk/sqlobject/sqlbuilder.py Sat Nov 26 06:12:03 2011 (r4484)
@@ -133,7 +133,7 @@
def __abs__(self):
return SQLConstant("ABS")(self)
def __mod__(self, other):
- return SQLConstant("MOD")(self, other)
+ return SQLModulo(self, other)
def __rmod__(self, other):
return SQLConstant("MOD")(other, self)
@@ -265,7 +265,18 @@
return operatorMap[self.op.upper()](execute(self.expr1, executor),
execute(self.expr2, executor))
+class SQLModulo(SQLOp):
+ def __init__(self, expr1, expr2):
+ SQLOp.__init__(self, '%', expr1, expr2)
+ def __sqlrepr__(self, db):
+ if db == 'sqlite':
+ return SQLOp.__sqlrepr__(self, db)
+ s1 = sqlrepr(self.expr1, db)
+ s2 = sqlrepr(self.expr2, db)
+ return "MOD(%s, %s)" % (s1, s2)
+
registerConverter(SQLOp, SQLExprConverter)
+registerConverter(SQLModulo, SQLExprConverter)
class SQLCall(SQLExpression):
def __init__(self, expr, args):
Modified: SQLObject/trunk/sqlobject/tests/test_sqlbuilder.py
==============================================================================
--- SQLObject/trunk/sqlobject/tests/test_sqlbuilder.py Sat Nov 26 06:09:55 2011 (r4483)
+++ SQLObject/trunk/sqlobject/tests/test_sqlbuilder.py Sat Nov 26 06:12:03 2011 (r4484)
@@ -34,6 +34,13 @@
sqlrepr(SQLOp("AND", 1, SQLOp("AND", 2, '3')), "sqlite") == \
"((1) AND ((2) AND ('3')))"
+def test_modulo():
+ setupClass(TestSQLBuilder)
+ assert sqlrepr(TestSQLBuilder.q.value % 2 == 0, 'mysql') == \
+ "((MOD(test_sql_builder.value, 2)) = (0))"
+ assert sqlrepr(TestSQLBuilder.q.value % 2 == 0, 'sqlite') == \
+ "(((test_sql_builder.value) % (2)) = (0))"
+
def test_str_or_sqlrepr():
select = Select(['id', 'name'], staticTables=['employees'],
where='value>0', orderBy='id')
|
|
From: <sub...@co...> - 2011-11-26 13:10:02
|
Author: phd
Date: Sat Nov 26 06:09:55 2011
New Revision: 4483
Log:
Merged revision 4482 from branch 1.1: a bug was fixed in handling ``modulo`` operator.
Modified:
SQLObject/branches/1.2/docs/News.txt
SQLObject/branches/1.2/sqlobject/sqlbuilder.py
SQLObject/branches/1.2/sqlobject/tests/test_sqlbuilder.py
Modified: SQLObject/branches/1.2/docs/News.txt
==============================================================================
--- SQLObject/branches/1.2/docs/News.txt Sat Nov 26 06:05:59 2011 (r4482)
+++ SQLObject/branches/1.2/docs/News.txt Sat Nov 26 06:09:55 2011 (r4483)
@@ -7,6 +7,11 @@
.. _start:
+SQLObject 1.2.1
+===============
+
+* A bugfix was ported from `SQLObject 1.1.4`_.
+
SQLObject 1.2.0
===============
@@ -37,6 +42,12 @@
* sqlobject.__doc__ and main.__doc__ no longer contain version number.
Use sqlobject.version or version_info.
+SQLObject 1.1.4
+===============
+
+* A bug was fixed in handling ``modulo`` operator - SQLite implements
+ only ``%``, MySQL - only ``MOD()``, PostgreSQL implements both.
+
SQLObject 1.1.3
===============
Modified: SQLObject/branches/1.2/sqlobject/sqlbuilder.py
==============================================================================
--- SQLObject/branches/1.2/sqlobject/sqlbuilder.py Sat Nov 26 06:05:59 2011 (r4482)
+++ SQLObject/branches/1.2/sqlobject/sqlbuilder.py Sat Nov 26 06:09:55 2011 (r4483)
@@ -133,7 +133,7 @@
def __abs__(self):
return SQLConstant("ABS")(self)
def __mod__(self, other):
- return SQLConstant("MOD")(self, other)
+ return SQLModulo(self, other)
def __rmod__(self, other):
return SQLConstant("MOD")(other, self)
@@ -265,7 +265,18 @@
return operatorMap[self.op.upper()](execute(self.expr1, executor),
execute(self.expr2, executor))
+class SQLModulo(SQLOp):
+ def __init__(self, expr1, expr2):
+ SQLOp.__init__(self, '%', expr1, expr2)
+ def __sqlrepr__(self, db):
+ if db == 'sqlite':
+ return SQLOp.__sqlrepr__(self, db)
+ s1 = sqlrepr(self.expr1, db)
+ s2 = sqlrepr(self.expr2, db)
+ return "MOD(%s, %s)" % (s1, s2)
+
registerConverter(SQLOp, SQLExprConverter)
+registerConverter(SQLModulo, SQLExprConverter)
class SQLCall(SQLExpression):
def __init__(self, expr, args):
Modified: SQLObject/branches/1.2/sqlobject/tests/test_sqlbuilder.py
==============================================================================
--- SQLObject/branches/1.2/sqlobject/tests/test_sqlbuilder.py Sat Nov 26 06:05:59 2011 (r4482)
+++ SQLObject/branches/1.2/sqlobject/tests/test_sqlbuilder.py Sat Nov 26 06:09:55 2011 (r4483)
@@ -34,6 +34,13 @@
sqlrepr(SQLOp("AND", 1, SQLOp("AND", 2, '3')), "sqlite") == \
"((1) AND ((2) AND ('3')))"
+def test_modulo():
+ setupClass(TestSQLBuilder)
+ assert sqlrepr(TestSQLBuilder.q.value % 2 == 0, 'mysql') == \
+ "((MOD(test_sql_builder.value, 2)) = (0))"
+ assert sqlrepr(TestSQLBuilder.q.value % 2 == 0, 'sqlite') == \
+ "(((test_sql_builder.value) % (2)) = (0))"
+
def test_str_or_sqlrepr():
select = Select(['id', 'name'], staticTables=['employees'],
where='value>0', orderBy='id')
|
|
From: <sub...@co...> - 2011-11-26 13:06:08
|
Author: phd
Date: Sat Nov 26 06:05:59 2011
New Revision: 4482
Log:
A bug was fixed in handling ``modulo`` operator - SQLite implements only ``%``.
Modified:
SQLObject/branches/1.1/docs/News.txt
SQLObject/branches/1.1/sqlobject/sqlbuilder.py
SQLObject/branches/1.1/sqlobject/tests/test_sqlbuilder.py
Modified: SQLObject/branches/1.1/docs/News.txt
==============================================================================
--- SQLObject/branches/1.1/docs/News.txt Sun Nov 20 04:57:00 2011 (r4481)
+++ SQLObject/branches/1.1/docs/News.txt Sat Nov 26 06:05:59 2011 (r4482)
@@ -7,6 +7,12 @@
.. _start:
+SQLObject 1.1.4
+===============
+
+* A bug was fixed in handling ``modulo`` operator - SQLite implements
+ only ``%``, MySQL - only ``MOD()``, PostgreSQL implements both.
+
SQLObject 1.1.3
===============
Modified: SQLObject/branches/1.1/sqlobject/sqlbuilder.py
==============================================================================
--- SQLObject/branches/1.1/sqlobject/sqlbuilder.py Sun Nov 20 04:57:00 2011 (r4481)
+++ SQLObject/branches/1.1/sqlobject/sqlbuilder.py Sat Nov 26 06:05:59 2011 (r4482)
@@ -127,7 +127,7 @@
def __abs__(self):
return SQLConstant("ABS")(self)
def __mod__(self, other):
- return SQLConstant("MOD")(self, other)
+ return SQLModulo(self, other)
def __rmod__(self, other):
return SQLConstant("MOD")(other, self)
@@ -259,7 +259,18 @@
return operatorMap[self.op.upper()](execute(self.expr1, executor),
execute(self.expr2, executor))
+class SQLModulo(SQLOp):
+ def __init__(self, expr1, expr2):
+ SQLOp.__init__(self, '%', expr1, expr2)
+ def __sqlrepr__(self, db):
+ if db == 'sqlite':
+ return SQLOp.__sqlrepr__(self, db)
+ s1 = sqlrepr(self.expr1, db)
+ s2 = sqlrepr(self.expr2, db)
+ return "MOD(%s, %s)" % (s1, s2)
+
registerConverter(SQLOp, SQLExprConverter)
+registerConverter(SQLModulo, SQLExprConverter)
class SQLCall(SQLExpression):
def __init__(self, expr, args):
Modified: SQLObject/branches/1.1/sqlobject/tests/test_sqlbuilder.py
==============================================================================
--- SQLObject/branches/1.1/sqlobject/tests/test_sqlbuilder.py Sun Nov 20 04:57:00 2011 (r4481)
+++ SQLObject/branches/1.1/sqlobject/tests/test_sqlbuilder.py Sat Nov 26 06:05:59 2011 (r4482)
@@ -33,3 +33,10 @@
assert sqlrepr(AND(1, 2, '3'), "sqlite") == \
sqlrepr(SQLOp("AND", 1, SQLOp("AND", 2, '3')), "sqlite") == \
"((1) AND ((2) AND ('3')))"
+
+def test_modulo():
+ setupClass(TestSQLBuilder)
+ assert sqlrepr(TestSQLBuilder.q.value % 2 == 0, 'mysql') == \
+ "((MOD(test_sql_builder.value, 2)) = (0))"
+ assert sqlrepr(TestSQLBuilder.q.value % 2 == 0, 'sqlite') == \
+ "(((test_sql_builder.value) % (2)) = (0))"
|
|
From: SourceForge.net <no...@so...> - 2011-11-25 15:35:59
|
Bugs item #3442071, was opened at 2011-11-25 07:35 Message generated for change (Tracker Item Submitted) made by vanity You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=3442071&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: Open Resolution: None Priority: 5 Private: No Submitted By: Tobias (vanity) Assigned to: Nobody/Anonymous (nobody) Summary: Modulo mapped to function instead of operator Initial Comment: With SQLObject 1.2.0 and whatever SQLite comes with Python 2.6, this following works fine: Video.select("""video.width % 2 == 1""")[0] But this raises sqlobject.dberrors.OperationalError: no such function: MOD: Video.select(Video.q.width % 2 == 1)[0] ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=3442071&group_id=74338 |
|
From: <sub...@co...> - 2011-11-20 11:57:06
|
Author: phd Date: Sun Nov 20 04:57:00 2011 New Revision: 4481 Log: Stable version 1.2.0. Modified: SQLObject/tags/1.2.0/README.txt SQLObject/tags/1.2.0/setup.cfg SQLObject/tags/1.2.0/sqlobject/__version__.py Modified: SQLObject/tags/1.2.0/README.txt ============================================================================== --- SQLObject/tags/1.2.0/README.txt Sun Nov 20 04:54:55 2011 (r4480) +++ SQLObject/tags/1.2.0/README.txt Sun Nov 20 04:57:00 2011 (r4481) @@ -1,5 +1,5 @@ -SQLObject 1.2 -============= +SQLObject 1.2.0 +=============== Thanks for looking at SQLObject. SQLObject is an object-relational mapper, i.e., a library that will wrap your database tables in Python Modified: SQLObject/tags/1.2.0/setup.cfg ============================================================================== --- SQLObject/tags/1.2.0/setup.cfg Sun Nov 20 04:54:55 2011 (r4480) +++ SQLObject/tags/1.2.0/setup.cfg Sun Nov 20 04:57:00 2011 (r4481) @@ -5,10 +5,6 @@ [easy_install] #find_links = http://svn.pythonpaste.org/package_index.html -[egg_info] -tag_build = dev -tag_svn_revision = true - [pudge] theme = pythonpaste.org docs = docs/index.txt docs/Authors.txt docs/DeveloperGuide.txt docs/FAQ.txt Modified: SQLObject/tags/1.2.0/sqlobject/__version__.py ============================================================================== --- SQLObject/tags/1.2.0/sqlobject/__version__.py Sun Nov 20 04:54:55 2011 (r4480) +++ SQLObject/tags/1.2.0/sqlobject/__version__.py Sun Nov 20 04:57:00 2011 (r4481) @@ -1,8 +1,8 @@ -version = '1.2' +version = '1.2.0' major = 1 minor = 2 micro = 0 -release_level = 'branch' +release_level = 'final' serial = 0 version_info = (major, minor, micro, release_level, serial) |
|
From: <sub...@co...> - 2011-11-20 11:55:02
|
Author: phd
Date: Sun Nov 20 04:54:55 2011
New Revision: 4480
Log:
Tagging 1.2.0
Added:
SQLObject/tags/1.2.0/
- copied from r4479, SQLObject/branches/1.2/
|
|
From: <sub...@co...> - 2011-11-20 11:54:09
|
Author: phd Date: Sun Nov 20 04:54:02 2011 New Revision: 4479 Log: Merged revision 4478 from branch 1.2: SQLObject 1.2.0 was released 20 Nov 2011. Modified: SQLObject/trunk/docs/News.txt Modified: SQLObject/trunk/docs/News.txt ============================================================================== --- SQLObject/trunk/docs/News.txt Sun Nov 20 04:52:33 2011 (r4478) +++ SQLObject/trunk/docs/News.txt Sun Nov 20 04:54:02 2011 (r4479) @@ -13,6 +13,8 @@ SQLObject 1.2.0 =============== +Released 20 Nov 2011. + Features & Interface -------------------- |
|
From: <sub...@co...> - 2011-11-20 11:52:43
|
Author: phd Date: Sun Nov 20 04:52:33 2011 New Revision: 4478 Log: SQLObject 1.2.0 was released 20 Nov 2011. Modified: SQLObject/branches/1.2/docs/News.txt Modified: SQLObject/branches/1.2/docs/News.txt ============================================================================== --- SQLObject/branches/1.2/docs/News.txt Sat Nov 5 08:34:15 2011 (r4477) +++ SQLObject/branches/1.2/docs/News.txt Sun Nov 20 04:52:33 2011 (r4478) @@ -10,6 +10,8 @@ SQLObject 1.2.0 =============== +Released 20 Nov 2011. + Features & Interface -------------------- |
|
From: <sub...@co...> - 2011-11-05 14:34:22
|
Author: phd
Date: Sat Nov 5 08:34:15 2011
New Revision: 4477
Log:
SQLObject 1.2.0b1.
Modified:
SQLObject/tags/1.2.0b1/README.txt
SQLObject/tags/1.2.0b1/setup.py
SQLObject/tags/1.2.0b1/sqlobject/__version__.py
Modified: SQLObject/tags/1.2.0b1/README.txt
==============================================================================
--- SQLObject/tags/1.2.0b1/README.txt Sat Nov 5 08:30:37 2011 (r4476)
+++ SQLObject/tags/1.2.0b1/README.txt Sat Nov 5 08:34:15 2011 (r4477)
@@ -1,5 +1,5 @@
-SQLObject 1.2
-=============
+SQLObject 1.2.0b1
+=================
Thanks for looking at SQLObject. SQLObject is an object-relational
mapper, i.e., a library that will wrap your database tables in Python
Modified: SQLObject/tags/1.2.0b1/setup.py
==============================================================================
--- SQLObject/tags/1.2.0b1/setup.py Sat Nov 5 08:30:37 2011 (r4476)
+++ SQLObject/tags/1.2.0b1/setup.py Sat Nov 5 08:34:15 2011 (r4477)
@@ -56,7 +56,7 @@
author="Ian Bicking",
author_email="ia...@co...",
url="http://sqlobject.org/",
- download_url="http://pypi.python.org/pypi/SQLObject/%s" % version,
+ download_url="http://pypi.python.org/pypi/SQLObject/1.2.0b1dev-r4477",
license="LGPL",
packages=["sqlobject"] + ['sqlobject.%s' % package for package in subpackages],
scripts=["scripts/sqlobject-admin", "scripts/sqlobject-convertOldURI"],
Modified: SQLObject/tags/1.2.0b1/sqlobject/__version__.py
==============================================================================
--- SQLObject/tags/1.2.0b1/sqlobject/__version__.py Sat Nov 5 08:30:37 2011 (r4476)
+++ SQLObject/tags/1.2.0b1/sqlobject/__version__.py Sat Nov 5 08:34:15 2011 (r4477)
@@ -1,8 +1,8 @@
-version = '1.2'
+version = '1.2.0b1'
major = 1
minor = 2
micro = 0
-release_level = 'branch'
-serial = 0
+release_level = 'beta'
+serial = 1
version_info = (major, minor, micro, release_level, serial)
|
|
From: <sub...@co...> - 2011-11-05 14:30:44
|
Author: phd
Date: Sat Nov 5 08:30:37 2011
New Revision: 4476
Log:
Tagging 1.2.0b1
Added:
SQLObject/tags/1.2.0b1/
- copied from r4475, SQLObject/branches/1.2/
|
|
From: <sub...@co...> - 2011-11-05 14:16:10
|
Author: phd Date: Sat Nov 5 08:16:03 2011 New Revision: 4475 Log: The next branch will be 1.3. Modified: SQLObject/trunk/README.txt SQLObject/trunk/sqlobject/__version__.py Modified: SQLObject/trunk/README.txt ============================================================================== --- SQLObject/trunk/README.txt Sat Nov 5 08:12:04 2011 (r4474) +++ SQLObject/trunk/README.txt Sat Nov 5 08:16:03 2011 (r4475) @@ -1,4 +1,4 @@ -SQLObject 1.2 +SQLObject 1.3 ============= Thanks for looking at SQLObject. SQLObject is an object-relational Modified: SQLObject/trunk/sqlobject/__version__.py ============================================================================== --- SQLObject/trunk/sqlobject/__version__.py Sat Nov 5 08:12:04 2011 (r4474) +++ SQLObject/trunk/sqlobject/__version__.py Sat Nov 5 08:16:03 2011 (r4475) @@ -1,7 +1,7 @@ -version = '1.2' +version = '1.3' major = 1 -minor = 2 +minor = 3 micro = 0 release_level = 'trunk' serial = 0 |