sqlobject-cvs Mailing List for SQLObject (Page 49)
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
|
Sep
|
Oct
|
Nov
|
Dec
|
From: SourceForge.net <no...@so...> - 2010-03-17 17:33:55
|
Patches item #2954013, was opened at 2010-02-18 07:48 Message generated for change (Comment added) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=2954013&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: None Priority: 5 Private: No Submitted By: dkeeney (dvkeeney) >Assigned to: Oleg Broytman (phd) Summary: Rdbhost connection module Initial Comment: Revised rdbconnection.py to simplify setting of database encoding. ---------------------------------------------------------------------- >Comment By: Oleg Broytman (phd) Date: 2010-03-17 20:33 Message: Applied in the revision 4132. Thank you! ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=2954013&group_id=74338 |
From: SourceForge.net <no...@so...> - 2010-03-17 17:33:25
|
Patches item #2925006, was opened at 2010-01-02 23:31 Message generated for change (Comment added) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=2925006&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: None Priority: 5 Private: No Submitted By: dkeeney (dvkeeney) >Assigned to: Oleg Broytman (phd) Summary: Adding support for Rdbhost Initial Comment: I am submitting 8 diffs (unified diff format) and two new files. The two new files constitute a new package that go with the other database (sub) packages. The two files are __init__.py and rdbconnection.py ---------------------------------------------------------------------- >Comment By: Oleg Broytman (phd) Date: 2010-03-17 20:33 Message: Applied in the revision 4132. Thank you! ---------------------------------------------------------------------- Comment By: dkeeney (dvkeeney) Date: 2010-01-02 23:45 Message: The change to test_picklecol.py.diff is just to a check for blob support, so for no-blob databases, the test is skipped rather than failed. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=2925006&group_id=74338 |
From: <sub...@co...> - 2010-03-17 17:29:48
|
Author: phd Date: 2010-03-17 11:29:41 -0600 (Wed, 17 Mar 2010) New Revision: 4133 Modified: SQLObject/trunk/sqlobject/tests/test_auto.py Log: Fixed a bug. Modified: SQLObject/trunk/sqlobject/tests/test_auto.py =================================================================== --- SQLObject/trunk/sqlobject/tests/test_auto.py 2010-03-17 17:20:30 UTC (rev 4132) +++ SQLObject/trunk/sqlobject/tests/test_auto.py 2010-03-17 17:29:41 UTC (rev 4133) @@ -164,7 +164,7 @@ DROP TABLE auto_test """ - sqliteDrop = sybaseDrop = mssqlDrop = postgresDrop = rdbhostDrop + sqliteDrop = sybaseDrop = mssqlDrop = rdbhostDrop = postgresDrop def setup_method(self, meth): conn = getConnection() |
From: <sub...@co...> - 2010-03-17 17:20:38
|
Author: phd Date: 2010-03-17 11:20:30 -0600 (Wed, 17 Mar 2010) New Revision: 4132 Added: SQLObject/trunk/sqlobject/rdbhost/ SQLObject/trunk/sqlobject/rdbhost/__init__.py SQLObject/trunk/sqlobject/rdbhost/rdbhostconnection.py Modified: SQLObject/trunk/docs/Authors.txt SQLObject/trunk/docs/News.txt SQLObject/trunk/sqlobject/conftest.py SQLObject/trunk/sqlobject/converters.py SQLObject/trunk/sqlobject/dbconnection.py SQLObject/trunk/sqlobject/sqlbuilder.py SQLObject/trunk/sqlobject/tests/dbtest.py SQLObject/trunk/sqlobject/tests/test_auto.py Log: Added a connection class for rdbhost.com (commercial Postgres-over-Web service). Modified: SQLObject/trunk/docs/Authors.txt =================================================================== --- SQLObject/trunk/docs/Authors.txt 2010-03-04 13:26:10 UTC (rev 4131) +++ SQLObject/trunk/docs/Authors.txt 2010-03-17 17:20:30 UTC (rev 4132) @@ -22,6 +22,7 @@ * Dan Pascu <dan at ag-projects.com> * Diez B. Roggisch <deets at web.de> * Christopher Singley <csingley at gmail.com> +* David Keeney <dkeeney at rdbhost.com> * Oleg Broytman <ph...@ph...> .. image:: http://sflogo.sourceforge.net/sflogo.php?group_id=74338&type=10 Modified: SQLObject/trunk/docs/News.txt =================================================================== --- SQLObject/trunk/docs/News.txt 2010-03-04 13:26:10 UTC (rev 4131) +++ SQLObject/trunk/docs/News.txt 2010-03-17 17:20:30 UTC (rev 4132) @@ -19,6 +19,9 @@ * Added TimedeltaCol; currently it's only implemented on PostgreSQL as an INTERVAL type. +* Added a connection class for rdbhost.com (commercial Postgres-over-Web + service). + Small Features -------------- Modified: SQLObject/trunk/sqlobject/conftest.py =================================================================== --- SQLObject/trunk/sqlobject/conftest.py 2010-03-04 13:26:10 UTC (rev 4131) +++ SQLObject/trunk/sqlobject/conftest.py 2010-03-17 17:20:30 UTC (rev 4132) @@ -23,6 +23,7 @@ 'dbm': 'dbm:///data', 'postgres': 'postgres:///test', 'postgresql': 'postgres:///test', + 'rdbhost': 'rdhbost://role:aut...@ww.../', 'pygresql': 'pygresql://localhost/test', 'sqlite': 'sqlite:/:memory:', 'sybase': 'sybase://test:test123@sybase/test?autoCommit=0', Modified: SQLObject/trunk/sqlobject/converters.py =================================================================== --- SQLObject/trunk/sqlobject/converters.py 2010-03-04 13:26:10 UTC (rev 4131) +++ SQLObject/trunk/sqlobject/converters.py 2010-03-17 17:20:30 UTC (rev 4132) @@ -83,7 +83,7 @@ elif isinstance(value, buffer): value = str(value) - if db in ('mysql', 'postgres'): + if db in ('mysql', 'postgres', 'rdbhost'): for orig, repl in sqlStringReplace: value = value.replace(orig, repl) elif db in ('sqlite', 'firebird', 'sybase', 'maxdb', 'mssql'): @@ -111,7 +111,7 @@ registerConverter(NumericType, IntConverter) def BoolConverter(value, db): - if db in ('postgres',): + if db in ('postgres', 'rdbhost'): if value: return "'t'" else: Modified: SQLObject/trunk/sqlobject/dbconnection.py =================================================================== --- SQLObject/trunk/sqlobject/dbconnection.py 2010-03-04 13:26:10 UTC (rev 4131) +++ SQLObject/trunk/sqlobject/dbconnection.py 2010-03-17 17:20:30 UTC (rev 4132) @@ -966,5 +966,6 @@ import mssql import mysql import postgres +import rdbhost import sqlite import sybase Added: SQLObject/trunk/sqlobject/rdbhost/__init__.py =================================================================== --- SQLObject/trunk/sqlobject/rdbhost/__init__.py (rev 0) +++ SQLObject/trunk/sqlobject/rdbhost/__init__.py 2010-03-17 17:20:30 UTC (rev 4132) @@ -0,0 +1,7 @@ +from sqlobject.dbconnection import registerConnection + +def builder(): + import rdbhostconnection + return rdbhostconnection.RdbhostConnection + +registerConnection(['rdbhost'], builder) Added: SQLObject/trunk/sqlobject/rdbhost/rdbhostconnection.py =================================================================== --- SQLObject/trunk/sqlobject/rdbhost/rdbhostconnection.py (rev 0) +++ SQLObject/trunk/sqlobject/rdbhost/rdbhostconnection.py 2010-03-17 17:20:30 UTC (rev 4132) @@ -0,0 +1,78 @@ +""" +This module written by David Keeney, 2009, 2010 + +Released under the LGPL for use with the SQLObject ORM library. +""" + +import re +from sqlobject import col +from sqlobject import sqlbuilder +from sqlobject.converters import registerConverter +from sqlobject.dbconnection import DBAPI +from sqlobject.postgres.pgconnection import PostgresConnection + +class RdbhostConnection(PostgresConnection): + + supportTransactions = False + dbName = 'rdbhost' + schemes = [dbName] + + def __init__(self, dsn=None, host=None, port=None, db=None, + user=None, password=None, backend='rdbhost', unicodeCols=False, + **kw): + backends = backend + for backend in backends.split(','): + backend = backend.strip() + if not backend: + continue + try: + if backend == 'rdbhost': + from rdbhdb import rdbhdb as rdb + # monkey patch % escaping into Cursor._execute + old_execute = getattr(rdb.Cursor, '_execute') + setattr(rdb.Cursor, '_old_execute', old_execute) + def _execute(self, query, *args): + assert not any([a for a in args]) + query = query.replace('%', '%%') + self._old_execute(query, (), (), ()) + setattr(rdb.Cursor, '_execute', _execute) + self.module = rdb + else: + raise ValueError('Unknown Rdbhost backend %s'%backend) + except ImportError: + pass + else: + break + else: + raise ImportError('Cannot find the Rdbhost backend') + self.user = user + self.host = host + self.port = port + self.db = db + self.password = password + self.dsn_dict = dsn_dict = {} + self.use_dsn = dsn is not None + if host: + dsn_dict["host"] = host + if user: + dsn_dict["role"] = user + if password: + dsn_dict["authcode"] = password + if dsn is None: + dsn = [] + if db: + dsn.append('dbname=%s' % db) + if user: + dsn.append('user=%s' % user) + if password: + dsn.append('password=%s' % password) + if host: + dsn.append('host=%s' % host) + if port: + dsn.append('port=%d' % port) + dsn = ' '.join(dsn) + self.dsn = dsn + self.unicodeCols = unicodeCols + self.schema = kw.pop('schema', None) + self.dbEncoding = 'utf-8' + DBAPI.__init__(self, **kw) Modified: SQLObject/trunk/sqlobject/sqlbuilder.py =================================================================== --- SQLObject/trunk/sqlobject/sqlbuilder.py 2010-03-04 13:26:10 UTC (rev 4131) +++ SQLObject/trunk/sqlobject/sqlbuilder.py 2010-03-17 17:20:30 UTC (rev 4132) @@ -912,7 +912,7 @@ raise TypeError, "expected str, unicode or SQLExpression, got %s" % type(s) def _quote_like_special(s, db): - if db == 'postgres': + if db in ('postgres', 'rdbhost'): escape = r'\\' else: escape = '\\' @@ -1178,6 +1178,7 @@ 'maxdb': 'RLIKE', 'mysql': 'RLIKE', 'postgres': '~', + 'rdbhost': '~', 'sqlite': 'REGEXP' } Modified: SQLObject/trunk/sqlobject/tests/dbtest.py =================================================================== --- SQLObject/trunk/sqlobject/tests/dbtest.py 2010-03-04 13:26:10 UTC (rev 4131) +++ SQLObject/trunk/sqlobject/tests/dbtest.py 2010-03-17 17:20:30 UTC (rev 4132) @@ -39,10 +39,10 @@ """ supportsMatrix = { '+exceptions': 'mysql sqlite', - '-transactions': 'mysql', + '-transactions': 'mysql rdbhost', '-dropTableCascade': 'sybase mssql', '-expressionIndex': 'mysql sqlite firebird mssql', - '-blobData': 'mssql', + '-blobData': 'mssql rdbhost', '-decimalColumn': 'mssql', '-emptyTable': 'mssql', '-limitSelect' : 'mssql', @@ -276,6 +276,7 @@ "The supportMatrix does not list this feature: %r" % feature) + # To avoid name clashes: _inserts = inserts Modified: SQLObject/trunk/sqlobject/tests/test_auto.py =================================================================== --- SQLObject/trunk/sqlobject/tests/test_auto.py 2010-03-04 13:26:10 UTC (rev 4131) +++ SQLObject/trunk/sqlobject/tests/test_auto.py 2010-03-17 17:20:30 UTC (rev 4132) @@ -104,6 +104,19 @@ ) """ + rdbhostCreate = """ + CREATE TABLE auto_test ( + auto_id SERIAL PRIMARY KEY, + first_name VARCHAR(100), + last_name VARCHAR(200) NOT NULL, + age INT DEFAULT 0, + created VARCHAR(40) NOT NULL, + happy char(1) DEFAULT 'Y' NOT NULL, + long_field TEXT, + wannahavefun BOOL DEFAULT FALSE NOT NULL + ) + """ + sqliteCreate = """ CREATE TABLE auto_test ( auto_id INTEGER PRIMARY KEY AUTOINCREMENT , @@ -151,7 +164,7 @@ DROP TABLE auto_test """ - sqliteDrop = sybaseDrop = mssqlDrop = postgresDrop + sqliteDrop = sybaseDrop = mssqlDrop = postgresDrop = rdbhostDrop def setup_method(self, meth): conn = getConnection() |
From: <sub...@co...> - 2010-03-04 13:26:21
|
Author: phd Date: 2010-03-04 06:26:10 -0700 (Thu, 04 Mar 2010) New Revision: 4131 Modified: SQLObject/tags/0.12.2/setup.cfg SQLObject/tags/0.12.2/setup.py SQLObject/tags/0.12.2/sqlobject/__init__.py SQLObject/tags/0.12.2/sqlobject/main.py Log: Stable version 0.12.2. Modified: SQLObject/tags/0.12.2/setup.cfg =================================================================== --- SQLObject/tags/0.12.2/setup.cfg 2010-03-04 13:24:43 UTC (rev 4130) +++ SQLObject/tags/0.12.2/setup.cfg 2010-03-04 13:26:10 UTC (rev 4131) @@ -2,13 +2,6 @@ command_packages = buildutils.pudge_command, buildutils.publish_command -[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/0.12.2/setup.py =================================================================== --- SQLObject/tags/0.12.2/setup.py 2010-03-04 13:24:43 UTC (rev 4130) +++ SQLObject/tags/0.12.2/setup.py 2010-03-04 13:26:10 UTC (rev 4131) @@ -21,7 +21,7 @@ """ setup(name="SQLObject", - version="0.12", + version="0.12.2", description="Object-Relational Manager, aka database wrapper", long_description="""\ SQLObject is a popular *Object Relational Manager* for providing an @@ -49,7 +49,7 @@ author="Ian Bicking", author_email="ia...@co...", url="http://sqlobject.org/", - download_url="http://cheeseshop.python.org/pypi/SQLObject/0.12", + download_url="http://cheeseshop.python.org/pypi/SQLObject/0.12.2", license="LGPL", packages=["sqlobject"] + ['sqlobject.%s' % package for package in subpackages], scripts=["scripts/sqlobject-admin"], Modified: SQLObject/tags/0.12.2/sqlobject/__init__.py =================================================================== --- SQLObject/tags/0.12.2/sqlobject/__init__.py 2010-03-04 13:24:43 UTC (rev 4130) +++ SQLObject/tags/0.12.2/sqlobject/__init__.py 2010-03-04 13:26:10 UTC (rev 4131) @@ -1,5 +1,5 @@ """ -SQLObject 0.12 +SQLObject 0.12.2 """ from col import * Modified: SQLObject/tags/0.12.2/sqlobject/main.py =================================================================== --- SQLObject/tags/0.12.2/sqlobject/main.py 2010-03-04 13:24:43 UTC (rev 4130) +++ SQLObject/tags/0.12.2/sqlobject/main.py 2010-03-04 13:26:10 UTC (rev 4131) @@ -1,6 +1,6 @@ """ -SQLObject 0.12 --------------- +SQLObject 0.12.2 +---------------- :author: Ian Bicking <ia...@co...> |
From: <sub...@co...> - 2010-03-04 13:24:50
|
Author: phd Date: 2010-03-04 06:24:43 -0700 (Thu, 04 Mar 2010) New Revision: 4130 Added: SQLObject/tags/0.12.2/ Log: Tagging 0.12.2 Copied: SQLObject/tags/0.12.2 (from rev 4129, SQLObject/branches/0.12) |
From: <sub...@co...> - 2010-03-04 13:24:04
|
Author: phd Date: 2010-03-04 06:23:58 -0700 (Thu, 04 Mar 2010) New Revision: 4129 Modified: SQLObject/trunk/docs/News.txt Log: SQLObject 0.12.2 and SQLObject 0.11.4 were released 4 Mar 2010. Modified: SQLObject/trunk/docs/News.txt =================================================================== --- SQLObject/trunk/docs/News.txt 2010-03-04 13:22:16 UTC (rev 4128) +++ SQLObject/trunk/docs/News.txt 2010-03-04 13:23:58 UTC (rev 4129) @@ -32,8 +32,10 @@ SQLObject 0.12.2 ================ -* A bugfix ported from `SQLObject 0.11.4`_. +Released 4 Mar 2010. +* Bugfixes ported from `SQLObject 0.11.4`_. + SQLObject 0.12.1 ================ @@ -96,6 +98,8 @@ SQLObject 0.11.4 ================ +Released 4 Mar 2010. + * Fixed a bug in inheritance - if creation of the row failed and if the connection is not a transaction and is in autocommit mode - remove parent row(s). |
From: <sub...@co...> - 2010-03-04 13:22:37
|
Author: phd Date: 2010-03-04 06:22:16 -0700 (Thu, 04 Mar 2010) New Revision: 4128 Modified: SQLObject/branches/0.12/docs/News.txt Log: SQLObject 0.12.2 and SQLObject 0.11.4 were released 4 Mar 2010. Modified: SQLObject/branches/0.12/docs/News.txt =================================================================== --- SQLObject/branches/0.12/docs/News.txt 2010-03-04 13:07:11 UTC (rev 4127) +++ SQLObject/branches/0.12/docs/News.txt 2010-03-04 13:22:16 UTC (rev 4128) @@ -10,8 +10,10 @@ SQLObject 0.12.2 ================ -* A bugfix ported from `SQLObject 0.11.4`_. +Released 4 Mar 2010. +* Bugfixes ported from `SQLObject 0.11.4`_. + SQLObject 0.12.1 ================ @@ -74,6 +76,8 @@ SQLObject 0.11.4 ================ +Released 4 Mar 2010. + * Fixed a bug in inheritance - if creation of the row failed and if the connection is not a transaction and is in autocommit mode - remove parent row(s). |
From: <sub...@co...> - 2010-03-04 13:07:18
|
Author: phd Date: 2010-03-04 06:07:11 -0700 (Thu, 04 Mar 2010) New Revision: 4127 Modified: SQLObject/tags/0.11.4/setup.cfg SQLObject/tags/0.11.4/setup.py SQLObject/tags/0.11.4/sqlobject/__init__.py SQLObject/tags/0.11.4/sqlobject/main.py Log: Stable version 0.11.4. Modified: SQLObject/tags/0.11.4/setup.cfg =================================================================== --- SQLObject/tags/0.11.4/setup.cfg 2010-03-04 13:04:35 UTC (rev 4126) +++ SQLObject/tags/0.11.4/setup.cfg 2010-03-04 13:07:11 UTC (rev 4127) @@ -2,13 +2,6 @@ command_packages = buildutils.pudge_command, buildutils.publish_command -[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/0.11.4/setup.py =================================================================== --- SQLObject/tags/0.11.4/setup.py 2010-03-04 13:04:35 UTC (rev 4126) +++ SQLObject/tags/0.11.4/setup.py 2010-03-04 13:07:11 UTC (rev 4127) @@ -21,7 +21,7 @@ """ setup(name="SQLObject", - version="0.11", + version="0.11.4", description="Object-Relational Manager, aka database wrapper", long_description="""\ SQLObject is a popular *Object Relational Manager* for providing an @@ -49,7 +49,7 @@ author="Ian Bicking", author_email="ia...@co...", url="http://sqlobject.org/", - download_url="http://cheeseshop.python.org/pypi/SQLObject/0.11", + download_url="http://cheeseshop.python.org/pypi/SQLObject/0.11.4", license="LGPL", packages=["sqlobject"] + ['sqlobject.%s' % package for package in subpackages], scripts=["scripts/sqlobject-admin"], Modified: SQLObject/tags/0.11.4/sqlobject/__init__.py =================================================================== --- SQLObject/tags/0.11.4/sqlobject/__init__.py 2010-03-04 13:04:35 UTC (rev 4126) +++ SQLObject/tags/0.11.4/sqlobject/__init__.py 2010-03-04 13:07:11 UTC (rev 4127) @@ -1,5 +1,5 @@ """ -SQLObject 0.11 +SQLObject 0.11.4 """ from main import * Modified: SQLObject/tags/0.11.4/sqlobject/main.py =================================================================== --- SQLObject/tags/0.11.4/sqlobject/main.py 2010-03-04 13:04:35 UTC (rev 4126) +++ SQLObject/tags/0.11.4/sqlobject/main.py 2010-03-04 13:07:11 UTC (rev 4127) @@ -1,6 +1,6 @@ """ -SQLObject 0.11 --------------- +SQLObject 0.11.4 +---------------- :author: Ian Bicking <ia...@co...> |
From: <sub...@co...> - 2010-03-04 13:04:41
|
Author: phd Date: 2010-03-04 06:04:35 -0700 (Thu, 04 Mar 2010) New Revision: 4126 Added: SQLObject/tags/0.11.4/ Log: Tagging 0.11.4 Copied: SQLObject/tags/0.11.4 (from rev 4125, SQLObject/branches/0.11) |
From: <sub...@co...> - 2010-03-04 12:57:47
|
Author: phd Date: 2010-03-04 05:57:39 -0700 (Thu, 04 Mar 2010) New Revision: 4125 Modified: SQLObject/branches/0.11/docs/News.txt Log: SQLObject 0.11.4 was released 4 Mar 2010. Modified: SQLObject/branches/0.11/docs/News.txt =================================================================== --- SQLObject/branches/0.11/docs/News.txt 2010-03-04 09:34:36 UTC (rev 4124) +++ SQLObject/branches/0.11/docs/News.txt 2010-03-04 12:57:39 UTC (rev 4125) @@ -10,6 +10,8 @@ SQLObject 0.11.4 ================ +Released 4 Mar 2010. + * Fixed a bug in inheritance - if creation of the row failed and if the connection is not a transaction and is in autocommit mode - remove parent row(s). |
From: <sub...@co...> - 2010-03-04 09:34:43
|
Author: phd Date: 2010-03-04 02:34:36 -0700 (Thu, 04 Mar 2010) New Revision: 4124 Modified: SQLObject/trunk/docs/links.txt Log: Merged revisions 4121, 4122 from branch 0.11: added a ink to DB migration using sqlobject-admin how-to; removed dead links; some links has been moved. Modified: SQLObject/trunk/docs/links.txt =================================================================== --- SQLObject/trunk/docs/links.txt 2010-03-04 09:34:20 UTC (rev 4123) +++ SQLObject/trunk/docs/links.txt 2010-03-04 09:34:36 UTC (rev 4124) @@ -8,25 +8,18 @@ Articles and Documentation -------------------------- -* `SQLObject and CherryPy - <http://www.cherrypy.org/wiki/SQLObjectThreadPerConnection>`_. - -* `SQLObject & Database Programming in Python - <http://ianbicking.org/docs/sqlobject-presentation/sqlobject-and-database-programming.html>`_; - slides from a presentation on SQLObject. - * `Connecting databases to Python with SQLObject - <http://www-128.ibm.com/developerworks/library/os-pythonsqlo/index.html?ca=drs>`_; + <http://www.ibm.com/developerworks/library/os-pythonsqlo/index.html>`_; an article at DeveloperWorks. +* `DB migration using sqlobject-admin how-to + <http://www.algorithm.co.il/blogs/index.php/programming/python/simple-sqlobject-db-migration-how-to/>`_. + * `Handling Form data with Formencode + SQLObject <http://www.groovie.org/articles/2005/08/24/handling-form-data-with-formencode-sqlobject>`_; a post by Ben Bangert about using SQLObject with `FormEncode <http://formencode.org>`_. -* `Translation of SQLObject documentation to Japanese - <http://ymasuda.jp/python/sqlobject/doc_0.7/>`_. - * `How to Use Database Agnostic SQL in SQLObject <http://groovie.org/articles/2005/11/01/how-to-use-database-agnostic-sql-in-sqlobject>`_. @@ -42,34 +35,19 @@ * `TurboGears <http://turbogears.org/>`_ Web Framework: also integrates with SQLObject. -* `Pylons <http://pylons.groovie.org/>`_ Web Framework: `Myghty +* `Pylons <http://pylonshq.com/>`_ Web Framework: `Myghty <http://www.myghty.org/>`_ based, with SQLObject integration. * `Catwalk <http://checkandshare.com/catwalk/>`_ is a web-based SQLObject browser and object editor (included in TurboGears) (`related blog items <http://www.checkandshare.com/blog/?cat=8>`_). -* `Nabu <http://furius.ca/nabu/>`_, a publishing system. - * `Ultra Gleeper <http://www.crummy.com/software/UltraGleeper/>`_, a Recommendation Engine for Web Pages. -* `Teeny Tiny CMS <http://footils.org/cms/show/3>`_. +* `rdflib <http://rdflib.net/>`_ contains a SQLObject backend. -* `rdflib <http://rdflib.net/>`_ contains a `SQLObject backend - <http://svn.rdflib.net/trunk/rdflib/backends/_sqlobject.py>`_. - -* Enfold Systems' `EnTransit - <http://www.enfoldsystems.com/About/Talks/entransit-tutorial.pdf>`_ - utilizes SQLObject and rdflib for storing transactional content from - Zope. Also by Enfold is `Sample Inventory Program - <http://www.enfoldsystems.com/Products/Open/SIP>`_, an Open Source - Laboratory Inventory Management Systems. - -* `Bauble <http://bauble.belizebotanic.org/>`_, a Biodiversity - Collection Manager. - -* `Anemon <http://anemon.org/wikini/wakka.php?wiki=FirstPage>`_ DHCP +* `Anemon <http://anemon.org/pmwiki/index.php?n=General.Presentation>`_ DHCP server. * `Guten <http://guten.sourceforge.net/>`_; an application for @@ -81,14 +59,6 @@ * `Stoq <http://www.stoq.com.br/>`_, an open source retail system. -Other Projects Using SQLObject ------------------------------- - -* `Reddit <http://reddit.com/>`_, "A source for what's new and popular - on the web -- customized for you." That's from their - FAQ... basically it's a list of user-submitted articles with a group - rating system, and personal adjustments. - .. image:: http://sflogo.sourceforge.net/sflogo.php?group_id=74338&type=10 :target: http://sourceforge.net/projects/sqlobject :class: noborder |
From: <sub...@co...> - 2010-03-04 09:34:26
|
Author: phd Date: 2010-03-04 02:34:20 -0700 (Thu, 04 Mar 2010) New Revision: 4123 Modified: SQLObject/branches/0.12/docs/links.txt Log: Merged revisions 4121, 4122 from branch 0.11: added a ink to DB migration using sqlobject-admin how-to; removed dead links; some links has been moved. Modified: SQLObject/branches/0.12/docs/links.txt =================================================================== --- SQLObject/branches/0.12/docs/links.txt 2010-03-04 09:32:44 UTC (rev 4122) +++ SQLObject/branches/0.12/docs/links.txt 2010-03-04 09:34:20 UTC (rev 4123) @@ -8,25 +8,18 @@ Articles and Documentation -------------------------- -* `SQLObject and CherryPy - <http://www.cherrypy.org/wiki/SQLObjectThreadPerConnection>`_. - -* `SQLObject & Database Programming in Python - <http://ianbicking.org/docs/sqlobject-presentation/sqlobject-and-database-programming.html>`_; - slides from a presentation on SQLObject. - * `Connecting databases to Python with SQLObject - <http://www-128.ibm.com/developerworks/library/os-pythonsqlo/index.html?ca=drs>`_; + <http://www.ibm.com/developerworks/library/os-pythonsqlo/index.html>`_; an article at DeveloperWorks. +* `DB migration using sqlobject-admin how-to + <http://www.algorithm.co.il/blogs/index.php/programming/python/simple-sqlobject-db-migration-how-to/>`_. + * `Handling Form data with Formencode + SQLObject <http://www.groovie.org/articles/2005/08/24/handling-form-data-with-formencode-sqlobject>`_; a post by Ben Bangert about using SQLObject with `FormEncode <http://formencode.org>`_. -* `Translation of SQLObject documentation to Japanese - <http://ymasuda.jp/python/sqlobject/doc_0.7/>`_. - * `How to Use Database Agnostic SQL in SQLObject <http://groovie.org/articles/2005/11/01/how-to-use-database-agnostic-sql-in-sqlobject>`_. @@ -42,34 +35,19 @@ * `TurboGears <http://turbogears.org/>`_ Web Framework: also integrates with SQLObject. -* `Pylons <http://pylons.groovie.org/>`_ Web Framework: `Myghty +* `Pylons <http://pylonshq.com/>`_ Web Framework: `Myghty <http://www.myghty.org/>`_ based, with SQLObject integration. * `Catwalk <http://checkandshare.com/catwalk/>`_ is a web-based SQLObject browser and object editor (included in TurboGears) (`related blog items <http://www.checkandshare.com/blog/?cat=8>`_). -* `Nabu <http://furius.ca/nabu/>`_, a publishing system. - * `Ultra Gleeper <http://www.crummy.com/software/UltraGleeper/>`_, a Recommendation Engine for Web Pages. -* `Teeny Tiny CMS <http://footils.org/cms/show/3>`_. +* `rdflib <http://rdflib.net/>`_ contains a SQLObject backend. -* `rdflib <http://rdflib.net/>`_ contains a `SQLObject backend - <http://svn.rdflib.net/trunk/rdflib/backends/_sqlobject.py>`_. - -* Enfold Systems' `EnTransit - <http://www.enfoldsystems.com/About/Talks/entransit-tutorial.pdf>`_ - utilizes SQLObject and rdflib for storing transactional content from - Zope. Also by Enfold is `Sample Inventory Program - <http://www.enfoldsystems.com/Products/Open/SIP>`_, an Open Source - Laboratory Inventory Management Systems. - -* `Bauble <http://bauble.belizebotanic.org/>`_, a Biodiversity - Collection Manager. - -* `Anemon <http://anemon.org/wikini/wakka.php?wiki=FirstPage>`_ DHCP +* `Anemon <http://anemon.org/pmwiki/index.php?n=General.Presentation>`_ DHCP server. * `Guten <http://guten.sourceforge.net/>`_; an application for @@ -81,14 +59,6 @@ * `Stoq <http://www.stoq.com.br/>`_, an open source retail system. -Other Projects Using SQLObject ------------------------------- - -* `Reddit <http://reddit.com/>`_, "A source for what's new and popular - on the web -- customized for you." That's from their - FAQ... basically it's a list of user-submitted articles with a group - rating system, and personal adjustments. - .. image:: http://sflogo.sourceforge.net/sflogo.php?group_id=74338&type=10 :target: http://sourceforge.net/projects/sqlobject :class: noborder |
From: <sub...@co...> - 2010-03-04 09:32:52
|
Author: phd Date: 2010-03-04 02:32:44 -0700 (Thu, 04 Mar 2010) New Revision: 4122 Modified: SQLObject/branches/0.11/docs/links.txt Log: Removed dead links. Some links has been moved. Modified: SQLObject/branches/0.11/docs/links.txt =================================================================== --- SQLObject/branches/0.11/docs/links.txt 2010-03-04 09:03:48 UTC (rev 4121) +++ SQLObject/branches/0.11/docs/links.txt 2010-03-04 09:32:44 UTC (rev 4122) @@ -8,34 +8,24 @@ Articles and Documentation -------------------------- -* `SQLObject and CherryPy - <http://www.cherrypy.org/wiki/SQLObjectThreadPerConnection>`_. - -* `SQLObject & Database Programming in Python - <http://ianbicking.org/docs/sqlobject-presentation/sqlobject-and-database-programming.html>`_; - slides from a presentation on SQLObject. - * `Connecting databases to Python with SQLObject - <http://www-128.ibm.com/developerworks/library/os-pythonsqlo/index.html?ca=drs>`_; + <http://www.ibm.com/developerworks/library/os-pythonsqlo/index.html>`_; an article at DeveloperWorks. +* `DB migration using sqlobject-admin how-to + <http://www.algorithm.co.il/blogs/index.php/programming/python/simple-sqlobject-db-migration-how-to/>`_. + * `Handling Form data with Formencode + SQLObject <http://www.groovie.org/articles/2005/08/24/handling-form-data-with-formencode-sqlobject>`_; a post by Ben Bangert about using SQLObject with `FormEncode <http://formencode.org>`_. -* `Translation of SQLObject documentation to Japanese - <http://ymasuda.jp/python/sqlobject/doc_0.7/>`_. - * `How to Use Database Agnostic SQL in SQLObject <http://groovie.org/articles/2005/11/01/how-to-use-database-agnostic-sql-in-sqlobject>`_. * `Using SQLObject with memcached <http://www.zachary.com/s/blog/2005/09/18/sqlobject_and_memcached,_part_1>`_. -* `DB migration using sqlobject-admin how-to - <http://www.algorithm.co.il/blogs/index.php/programming/python/simple-sqlobject-db-migration-how-to/>`_. - Open Source Projects -------------------- @@ -45,34 +35,19 @@ * `TurboGears <http://turbogears.org/>`_ Web Framework: also integrates with SQLObject. -* `Pylons <http://pylons.groovie.org/>`_ Web Framework: `Myghty +* `Pylons <http://pylonshq.com/>`_ Web Framework: `Myghty <http://www.myghty.org/>`_ based, with SQLObject integration. * `Catwalk <http://checkandshare.com/catwalk/>`_ is a web-based SQLObject browser and object editor (included in TurboGears) (`related blog items <http://www.checkandshare.com/blog/?cat=8>`_). -* `Nabu <http://furius.ca/nabu/>`_, a publishing system. - * `Ultra Gleeper <http://www.crummy.com/software/UltraGleeper/>`_, a Recommendation Engine for Web Pages. -* `Teeny Tiny CMS <http://footils.org/cms/show/3>`_. +* `rdflib <http://rdflib.net/>`_ contains a SQLObject backend. -* `rdflib <http://rdflib.net/>`_ contains a `SQLObject backend - <http://svn.rdflib.net/trunk/rdflib/backends/_sqlobject.py>`_. - -* Enfold Systems' `EnTransit - <http://www.enfoldsystems.com/About/Talks/entransit-tutorial.pdf>`_ - utilizes SQLObject and rdflib for storing transactional content from - Zope. Also by Enfold is `Sample Inventory Program - <http://www.enfoldsystems.com/Products/Open/SIP>`_, an Open Source - Laboratory Inventory Management Systems. - -* `Bauble <http://bauble.belizebotanic.org/>`_, a Biodiversity - Collection Manager. - -* `Anemon <http://anemon.org/wikini/wakka.php?wiki=FirstPage>`_ DHCP +* `Anemon <http://anemon.org/pmwiki/index.php?n=General.Presentation>`_ DHCP server. * `Guten <http://guten.sourceforge.net/>`_; an application for @@ -84,14 +59,6 @@ * `Stoq <http://www.stoq.com.br/>`_, an open source retail system. -Other Projects Using SQLObject ------------------------------- - -* `Reddit <http://reddit.com/>`_, "A source for what's new and popular - on the web -- customized for you." That's from their - FAQ... basically it's a list of user-submitted articles with a group - rating system, and personal adjustments. - .. image:: http://sflogo.sourceforge.net/sflogo.php?group_id=74338&type=10 :target: http://sourceforge.net/projects/sqlobject :class: noborder |
From: <sub...@co...> - 2010-03-04 09:03:56
|
Author: phd Date: 2010-03-04 02:03:48 -0700 (Thu, 04 Mar 2010) New Revision: 4121 Modified: SQLObject/branches/0.11/docs/links.txt Log: Added a ink to DB migration using sqlobject-admin how-to. Modified: SQLObject/branches/0.11/docs/links.txt =================================================================== --- SQLObject/branches/0.11/docs/links.txt 2010-03-03 18:38:38 UTC (rev 4120) +++ SQLObject/branches/0.11/docs/links.txt 2010-03-04 09:03:48 UTC (rev 4121) @@ -33,6 +33,9 @@ * `Using SQLObject with memcached <http://www.zachary.com/s/blog/2005/09/18/sqlobject_and_memcached,_part_1>`_. +* `DB migration using sqlobject-admin how-to + <http://www.algorithm.co.il/blogs/index.php/programming/python/simple-sqlobject-db-migration-how-to/>`_. + Open Source Projects -------------------- |
From: <sub...@co...> - 2010-03-03 18:38:44
|
Author: phd Date: 2010-03-03 11:38:38 -0700 (Wed, 03 Mar 2010) New Revision: 4120 Removed: SQLObject/trunk/sqlobject/tests/test_auto_old.py Modified: SQLObject/trunk/sqlobject/tests/test_auto.py Log: 'created' is a datetime column. Modified: SQLObject/trunk/sqlobject/tests/test_auto.py =================================================================== --- SQLObject/trunk/sqlobject/tests/test_auto.py 2010-03-03 18:37:57 UTC (rev 4119) +++ SQLObject/trunk/sqlobject/tests/test_auto.py 2010-03-03 18:38:38 UTC (rev 4120) @@ -97,7 +97,7 @@ first_name VARCHAR(100), last_name VARCHAR(200) NOT NULL, age INT DEFAULT 0, - created VARCHAR(40) NOT NULL, + created TIMESTAMP NOT NULL, happy char(1) DEFAULT 'Y' NOT NULL, long_field TEXT, wannahavefun BOOL DEFAULT FALSE NOT NULL @@ -123,7 +123,7 @@ first_name VARCHAR(100), last_name VARCHAR(200) NOT NULL, age INT DEFAULT 0, - created VARCHAR(40) NOT NULL, + created DATETIME NOT NULL, happy char(1) DEFAULT 'Y' NOT NULL, long_field TEXT, wannahavefun BIT default(0) NOT NULL @@ -136,7 +136,7 @@ first_name VARCHAR(100), last_name VARCHAR(200) NOT NULL, age INT DEFAULT 0, - created VARCHAR(40) NOT NULL, + created DATETIME NOT NULL, happy char(1) DEFAULT 'Y' NOT NULL, long_field TEXT, wannahavefun BIT default(0) NOT NULL Deleted: SQLObject/trunk/sqlobject/tests/test_auto_old.py =================================================================== --- SQLObject/trunk/sqlobject/tests/test_auto_old.py 2010-03-03 18:37:57 UTC (rev 4119) +++ SQLObject/trunk/sqlobject/tests/test_auto_old.py 2010-03-03 18:38:38 UTC (rev 4120) @@ -1,127 +0,0 @@ -from datetime import datetime -now = datetime.now - -from sqlobject import * -from sqlobject.tests.dbtest import * -from sqlobject import classregistry - -######################################## -## Auto class generation -######################################## - -class TestAuto: - - mysqlCreate = """ - CREATE TABLE IF NOT EXISTS old_auto_test ( - auto_id INT AUTO_INCREMENT PRIMARY KEY, - first_name VARCHAR(100), - last_name VARCHAR(200) NOT NULL, - age INT DEFAULT NULL, - created DATETIME NOT NULL, - happy char(1) DEFAULT 'Y' NOT NULL, - long_field TEXT, - wannahavefun TINYINT DEFAULT 0 NOT NULL - ) - """ - - postgresCreate = """ - CREATE TABLE old_auto_test ( - auto_id SERIAL PRIMARY KEY, - first_name VARCHAR(100), - last_name VARCHAR(200) NOT NULL, - age INT DEFAULT 0, - created VARCHAR(40) NOT NULL, - happy char(1) DEFAULT 'Y' NOT NULL, - long_field TEXT, - wannahavefun BOOL DEFAULT FALSE NOT NULL - ) - """ - - sqliteCreate = """ - CREATE TABLE old_auto_test ( - auto_id INTEGER PRIMARY KEY AUTOINCREMENT , - first_name VARCHAR(100), - last_name VARCHAR(200) NOT NULL, - age INT DEFAULT NULL, - created DATETIME NOT NULL, - happy char(1) DEFAULT 'Y' NOT NULL, - long_field TEXT, - wannahavefun INT DEFAULT 0 NOT NULL - ) - """ - - sybaseCreate = """ - CREATE TABLE old_auto_test ( - auto_id integer, - first_name VARCHAR(100), - last_name VARCHAR(200) NOT NULL, - age INT DEFAULT 0, - created VARCHAR(40) NOT NULL, - happy char(1) DEFAULT 'Y' NOT NULL, - long_field TEXT - ) - """ - - mssqlCreate = """ - CREATE TABLE old_auto_test ( - auto_id int IDENTITY(1,1) primary key, - first_name VARCHAR(100), - last_name VARCHAR(200) NOT NULL, - age INT DEFAULT 0, - created VARCHAR(40) NOT NULL, - happy char(1) DEFAULT 'Y' NOT NULL, - long_field TEXT, - wannahavefun BIT default(0) NOT NULL - ) - """ - - mysqlDrop = """ - DROP TABLE IF EXISTS old_auto_test - """ - - postgresDrop = """ - DROP TABLE old_auto_test - """ - - sqliteDrop = sybaseDrop = mssqlDrop = postgresDrop - - def setup_method(self, meth): - conn = getConnection() - dbName = conn.dbName - creator = getattr(self, dbName + 'Create', None) - if creator: - conn.query(creator) - - def teardown_method(self, meth): - conn = getConnection() - dbName = conn.dbName - dropper = getattr(self, dbName + 'Drop', None) - if dropper: - conn.query(dropper) - - def test_classCreate(self): - class OldAutoTest(SQLObject): - _connection = getConnection() - class sqlmeta(sqlmeta): - idName = 'auto_id' - fromDatabase = True - john = OldAutoTest(firstName='john', - lastName='doe', - age=10, - created=now(), - wannahavefun=False, - longField='x'*1000) - jane = OldAutoTest(firstName='jane', - lastName='doe', - happy='N', - created=now(), - wannahavefun=True, - longField='x'*1000) - assert not john.wannahavefun - assert jane.wannahavefun - assert john.longField == 'x'*1000 - assert jane.longField == 'x'*1000 - del classregistry.registry( - OldAutoTest.sqlmeta.registry).classes['OldAutoTest'] - -teardown_module() |
From: <sub...@co...> - 2010-03-03 18:38:05
|
Author: phd Date: 2010-03-03 11:37:57 -0700 (Wed, 03 Mar 2010) New Revision: 4119 Modified: SQLObject/trunk/sqlobject/col.py Log: Test connection-specific Binary type and buffer type. Modified: SQLObject/trunk/sqlobject/col.py =================================================================== --- SQLObject/trunk/sqlobject/col.py 2010-03-03 17:51:12 UTC (rev 4118) +++ SQLObject/trunk/sqlobject/col.py 2010-03-03 18:37:57 UTC (rev 4119) @@ -507,6 +507,9 @@ return self._sqlType() +# Special marker to test the dataType is a backend-specific Binary +testDataTypeBinary = object() + class StringValidator(validators.Validator): def to_python(self, value, state): @@ -516,20 +519,32 @@ connection = state.soObject._connection dbEncoding = getattr(connection, "dbEncoding", None) or "ascii" return value.encode(dbEncoding) - if isinstance(value, (str, sqlbuilder.SQLExpression)): + if isinstance(value, (str, buffer, sqlbuilder.SQLExpression)): return value - if self.dataType and isinstance(value, self.dataType): - return value + if self.dataType: + if self.dataType is testDataTypeBinary: + connection = state.soObject._connection + dataType = connection._binaryType + else: + dataType = self.dataType + if isinstance(value, dataType): + return value raise validators.Invalid("expected a str in the StringCol '%s', got %s %r instead" % \ (self.name, type(value), value), value, state) def from_python(self, value, state): if value is None: return None - if isinstance(value, (str, sqlbuilder.SQLExpression)): + if isinstance(value, (str, buffer, sqlbuilder.SQLExpression)): return value - if self.dataType and isinstance(value, self.dataType): - return value + if self.dataType: + if self.dataType is testDataTypeBinary: + connection = state.soObject._connection + dataType = connection._binaryType + else: + dataType = self.dataType + if isinstance(value, dataType): + return value if isinstance(value, unicode): connection = state.soObject._connection dbEncoding = getattr(connection, "dbEncoding", None) or "ascii" @@ -1469,7 +1484,7 @@ def createValidators(self): return [BinaryValidator(name=self.name)] + \ - super(SOBLOBCol, self).createValidators(dataType=buffer) + super(SOBLOBCol, self).createValidators(dataType=testDataTypeBinary) def _mysqlType(self): length = self.length |
From: <sub...@co...> - 2010-03-03 17:51:18
|
Author: phd Date: 2010-03-03 10:51:12 -0700 (Wed, 03 Mar 2010) New Revision: 4118 Modified: SQLObject/trunk/sqlobject/col.py Log: Added from_python to TimeValidator, the same as to_python, to allow str => time conversion. Modified: SQLObject/trunk/sqlobject/col.py =================================================================== --- SQLObject/trunk/sqlobject/col.py 2010-03-03 17:48:17 UTC (rev 4117) +++ SQLObject/trunk/sqlobject/col.py 2010-03-03 17:51:12 UTC (rev 4118) @@ -1229,6 +1229,8 @@ value = value.time() return value + from_python = to_python + class SOTimeCol(SOCol): timeFormat = '%H:%M:%S' |
From: <sub...@co...> - 2010-03-03 17:48:24
|
Author: phd Date: 2010-03-03 10:48:17 -0700 (Wed, 03 Mar 2010) New Revision: 4117 Modified: SQLObject/trunk/docs/News.txt SQLObject/trunk/sqlobject/col.py SQLObject/trunk/sqlobject/tests/test_basic.py Log: Validators became stricter: StringCol and UnicodeCol now accept only str or unicode, BoolCol accepts only bool or int, and so on. Modified: SQLObject/trunk/docs/News.txt =================================================================== --- SQLObject/trunk/docs/News.txt 2010-03-03 17:02:52 UTC (rev 4116) +++ SQLObject/trunk/docs/News.txt 2010-03-03 17:48:17 UTC (rev 4117) @@ -26,6 +26,9 @@ the case of inherited idName inherited value takes precedence; to allow Style to set idName reset inherited idName to None. +* Validators became stricter: StringCol and UnicodeCol now accept only str + or unicode, BoolCol accepts only bool or int, and so on. + SQLObject 0.12.2 ================ Modified: SQLObject/trunk/sqlobject/col.py =================================================================== --- SQLObject/trunk/sqlobject/col.py 2010-03-03 17:02:52 UTC (rev 4116) +++ SQLObject/trunk/sqlobject/col.py 2010-03-03 17:48:17 UTC (rev 4117) @@ -516,23 +516,31 @@ connection = state.soObject._connection dbEncoding = getattr(connection, "dbEncoding", None) or "ascii" return value.encode(dbEncoding) - return value + if isinstance(value, (str, sqlbuilder.SQLExpression)): + return value + if self.dataType and isinstance(value, self.dataType): + return value + raise validators.Invalid("expected a str in the StringCol '%s', got %s %r instead" % \ + (self.name, type(value), value), value, state) def from_python(self, value, state): if value is None: return None - if isinstance(value, str): + if isinstance(value, (str, sqlbuilder.SQLExpression)): return value + if self.dataType and isinstance(value, self.dataType): + return value if isinstance(value, unicode): connection = state.soObject._connection dbEncoding = getattr(connection, "dbEncoding", None) or "ascii" return value.encode(dbEncoding) - return value + raise validators.Invalid("expected a str in the StringCol '%s', got %s %r instead" % \ + (self.name, type(value), value), value, state) class SOStringCol(SOStringLikeCol): - def createValidators(self): - return [StringValidator()] + \ + def createValidators(self, dataType=None): + return [StringValidator(name=self.name, dataType=dataType)] + \ super(SOStringCol, self).createValidators() class StringCol(Col): @@ -543,18 +551,24 @@ def to_python(self, value, state): if value is None: return None - if isinstance(value, unicode): + if isinstance(value, (unicode, sqlbuilder.SQLExpression)): return value + if isinstance(value, str): + return unicode(value, self.db_encoding) if isinstance(value, array): # MySQL return unicode(value.tostring(), self.db_encoding) - return unicode(value, self.db_encoding) + raise validators.Invalid("expected a str or a unicode in the UnicodeCol '%s', got %s %r instead" % \ + (self.name, type(value), value), value, state) def from_python(self, value, state): if value is None: return None - if isinstance(value, str): + if isinstance(value, (str, sqlbuilder.SQLExpression)): return value - return value.encode(self.db_encoding) + if isinstance(value, unicode): + return value.encode(self.db_encoding) + raise validators.Invalid("expected a str or a unicode in the UnicodeCol '%s', got %s %r instead" % \ + (self.name, type(value), value), value, state) class SOUnicodeCol(SOStringLikeCol): def __init__(self, **kw): @@ -562,7 +576,8 @@ super(SOUnicodeCol, self).__init__(**kw) def createValidators(self): - return [UnicodeStringValidator(db_encoding=self.dbEncoding)] + \ + return [UnicodeStringValidator(name=self.name, + db_encoding=self.dbEncoding)] + \ super(SOUnicodeCol, self).createValidators() class UnicodeCol(Col): @@ -585,10 +600,10 @@ def from_python(self, value, state): if value is None: return None - if not isinstance(value, (int, long, sqlbuilder.SQLExpression)): - raise validators.Invalid("expected an int in the IntCol '%s', got %s %r instead" % \ - (self.name, type(value), value), value, state) - return value + if isinstance(value, (int, long, sqlbuilder.SQLExpression)): + return value + raise validators.Invalid("expected an int in the IntCol '%s', got %s %r instead" % \ + (self.name, type(value), value), value, state) class SOIntCol(SOCol): # 3-03 @@: support precision, maybe max and min directly @@ -658,25 +673,21 @@ def to_python(self, value, state): if value is None: return None - elif not value: - return False - else: - return True + if isinstance(value, (bool, sqlbuilder.SQLExpression)): + return value + if isinstance(value, (int, long)): + return bool(value) + raise validators.Invalid("expected a bool or an int in the BoolCol '%s', got %s %r instead" % \ + (self.name, type(value), value), value, state) - def from_python(self, value, state): - if value is None: - return None - elif value: - return True - else: - return False + from_python = to_python class SOBoolCol(SOCol): def autoConstraints(self): return [consts.isBool] def createValidators(self): - return [BoolValidator()] + \ + return [BoolValidator(name=self.name)] + \ super(SOBoolCol, self).createValidators() def _postgresType(self): @@ -711,19 +722,10 @@ return None if isinstance(value, (int, long, float, sqlbuilder.SQLExpression)): return value - try: - return float(value) - except: - raise validators.Invalid("expected a float in the FloatCol '%s', got %s %r instead" % \ - (self.name, type(value), value), value, state) + raise validators.Invalid("expected a float in the FloatCol '%s', got %s %r instead" % \ + (self.name, type(value), value), value, state) - def from_python(self, value, state): - if value is None: - return None - if not isinstance(value, (int, long, float, sqlbuilder.SQLExpression)): - raise validators.Invalid("expected a float in the FloatCol '%s', got %s %r instead" % \ - (self.name, type(value), value), value, state) - return value + from_python = to_python class SOFloatCol(SOCol): # 3-03 @@: support precision (e.g., DECIMAL) @@ -922,12 +924,10 @@ return value elif not self.notNone and value is None: return None - else: - raise validators.Invalid("expected a member of %r in the EnumCol '%s', got %r instead" % \ - (self.enumValues, self.name, value), value, state) + raise validators.Invalid("expected a member of %r in the EnumCol '%s', got %r instead" % \ + (self.enumValues, self.name, value), value, state) - def from_python(self, value, state): - return self.to_python(value, state) + from_python = to_python class SOEnumCol(SOCol): @@ -997,15 +997,19 @@ """ def to_python(self, value, state): - if not isinstance(value, str): - raise validators.Invalid("expected a value string, got % instead" % \ - (value), value, state) - return tuple(value.split(",")) + if isinstance(value, str): + return tuple(value.split(",")) + raise validators.Invalid("expected a string in the SetCol '%s', got %s %r instead" % \ + (self.name, type(value), value), value, state) def from_python(self, value, state): - if not isinstance(value, tuple): + if isinstance(value, basestring): value = (value,) - return ",".join([v for v in value]) + try: + return ",".join(value) + except: + raise validators.Invalid("expected a string or a sequence of stringsin the SetCol '%s', got %s %r instead" % \ + (self.name, type(value), value), value, state) class SOSetCol(SOCol): def __init__(self, **kw): @@ -1154,7 +1158,7 @@ def to_python(self, value, state): if isinstance(value, datetime.datetime): value = value.date() - if isinstance(value, datetime.date): + if isinstance(value, (datetime.date, sqlbuilder.SQLExpression)): return value value = super(DateValidator, self).to_python(value, state) if isinstance(value, datetime.datetime): @@ -1212,7 +1216,7 @@ class TimeValidator(DateTimeValidator): def to_python(self, value, state): - if isinstance(value, datetime.time): + if isinstance(value, (datetime.time, sqlbuilder.SQLExpression)): return value if isinstance(value, datetime.timedelta): if value.days: @@ -1287,8 +1291,7 @@ def to_python(self, value, state): return value - def from_python(self, value, state): - return value + from_python = to_python class SOTimedeltaCol(SOCol): def _postgresType(self): @@ -1335,10 +1338,10 @@ except: raise validators.Invalid("can not parse Decimal value '%s' in the DecimalCol from '%s'" % (value, getattr(state, 'soObject', '(unknown)')), value, state) - if not isinstance(value, (int, long, Decimal, sqlbuilder.SQLExpression)): - raise validators.Invalid("expected a decimal in the DecimalCol '%s', got %s %r instead" % \ - (self.name, type(value), value), value, state) - return value + if isinstance(value, (int, long, Decimal, sqlbuilder.SQLExpression)): + return value + raise validators.Invalid("expected a Decimal in the DecimalCol '%s', got %s %r instead" % \ + (self.name, type(value), value), value, state) class SODecimalCol(SOCol): @@ -1409,12 +1412,13 @@ def createValidators(self): if self.quantize: - v = DecimalStringValidator( + v = DecimalStringValidator(name=self.name, precision=Decimal(10) ** (-1 * int(self.precision)), max=Decimal(10) ** (int(self.size) - int(self.precision))) else: - v = DecimalStringValidator(precision=0) - return [v] + super(SODecimalStringCol, self).createValidators() + v = DecimalStringValidator(name=self.name, precision=0) + return [v] + \ + super(SODecimalStringCol, self).createValidators(dataType=Decimal) class DecimalStringCol(StringCol): baseClass = SODecimalStringCol @@ -1463,7 +1467,7 @@ def createValidators(self): return [BinaryValidator(name=self.name)] + \ - super(SOBLOBCol, self).createValidators() + super(SOBLOBCol, self).createValidators(dataType=buffer) def _mysqlType(self): length = self.length @@ -1523,8 +1527,8 @@ super(SOPickleCol, self).__init__(**kw) def createValidators(self): - return [PickleValidator( - name=self.name, pickleProtocol=self.pickleProtocol)] + \ + return [PickleValidator(name=self.name, + pickleProtocol=self.pickleProtocol)] + \ super(SOPickleCol, self).createValidators() def _mysqlType(self): Modified: SQLObject/trunk/sqlobject/tests/test_basic.py =================================================================== --- SQLObject/trunk/sqlobject/tests/test_basic.py 2010-03-03 17:02:52 UTC (rev 4116) +++ SQLObject/trunk/sqlobject/tests/test_basic.py 2010-03-03 17:48:17 UTC (rev 4117) @@ -79,7 +79,7 @@ setupClass(Student) student = Student(is_smart=False) assert student.is_smart == False - student2 = Student(is_smart='false') + student2 = Student(is_smart=1) assert student2.is_smart == True class TestSO3(SQLObject): |
From: <sub...@co...> - 2010-03-03 17:08:21
|
Author: phd Date: 2010-03-03 09:50:47 -0700 (Wed, 03 Mar 2010) New Revision: 4115 Modified: SQLObject/trunk/sqlobject/main.py Log: Merged revision 4113 from branch 0.11: compare identities. Modified: SQLObject/trunk/sqlobject/main.py =================================================================== --- SQLObject/trunk/sqlobject/main.py 2010-03-03 16:50:22 UTC (rev 4114) +++ SQLObject/trunk/sqlobject/main.py 2010-03-03 16:50:47 UTC (rev 4115) @@ -921,7 +921,7 @@ # If no connection was given, we'll inherit the class # instance variable which should have a _connection # attribute. - if (connection is not None) and (self._connection != connection): + if (connection is not None) and (self._connection is not connection): self._connection = connection # Sometimes we need to know if this instance is # global or tied to a particular connection. @@ -1208,7 +1208,7 @@ # Pass the connection object along if we were given one. if kw.has_key('connection'): connection = kw.pop('connection') - if self._connection != connection: + if self._connection is not connection: self._connection = connection self.sqlmeta._perConnection = True |
From: <sub...@co...> - 2010-03-03 17:08:14
|
Author: phd Date: 2010-03-03 09:48:54 -0700 (Wed, 03 Mar 2010) New Revision: 4113 Modified: SQLObject/branches/0.11/sqlobject/main.py Log: Compare identities - connections don't support comparison. Modified: SQLObject/branches/0.11/sqlobject/main.py =================================================================== --- SQLObject/branches/0.11/sqlobject/main.py 2010-03-01 05:59:22 UTC (rev 4112) +++ SQLObject/branches/0.11/sqlobject/main.py 2010-03-03 16:48:54 UTC (rev 4113) @@ -922,7 +922,7 @@ # If no connection was given, we'll inherit the class # instance variable which should have a _connection # attribute. - if (connection is not None) and (self._connection != connection): + if (connection is not None) and (self._connection is not connection): self._connection = connection # Sometimes we need to know if this instance is # global or tied to a particular connection. @@ -1209,7 +1209,7 @@ # Pass the connection object along if we were given one. if kw.has_key('connection'): connection = kw.pop('connection') - if self._connection != connection: + if self._connection is not connection: self._connection = connection self.sqlmeta._perConnection = True |
From: <sub...@co...> - 2010-03-03 17:08:08
|
Author: phd Date: 2010-03-03 09:50:22 -0700 (Wed, 03 Mar 2010) New Revision: 4114 Modified: SQLObject/branches/0.12/sqlobject/main.py Log: Merged revision 4113 from branch 0.11: compare identities. Modified: SQLObject/branches/0.12/sqlobject/main.py =================================================================== --- SQLObject/branches/0.12/sqlobject/main.py 2010-03-03 16:48:54 UTC (rev 4113) +++ SQLObject/branches/0.12/sqlobject/main.py 2010-03-03 16:50:22 UTC (rev 4114) @@ -920,7 +920,7 @@ # If no connection was given, we'll inherit the class # instance variable which should have a _connection # attribute. - if (connection is not None) and (self._connection != connection): + if (connection is not None) and (self._connection is not connection): self._connection = connection # Sometimes we need to know if this instance is # global or tied to a particular connection. @@ -1207,7 +1207,7 @@ # Pass the connection object along if we were given one. if kw.has_key('connection'): connection = kw.pop('connection') - if self._connection != connection: + if self._connection is not connection: self._connection = connection self.sqlmeta._perConnection = True |
From: <sub...@co...> - 2010-03-03 17:02:59
|
Author: phd Date: 2010-03-03 10:02:52 -0700 (Wed, 03 Mar 2010) New Revision: 4116 Modified: SQLObject/trunk/sqlobject/tests/test_pickle.py Log: Fixed a test that an instance with a per-instance connection cannot be pickled. Modified: SQLObject/trunk/sqlobject/tests/test_pickle.py =================================================================== --- SQLObject/trunk/sqlobject/tests/test_pickle.py 2010-03-03 16:50:47 UTC (rev 4115) +++ SQLObject/trunk/sqlobject/tests/test_pickle.py 2010-03-03 17:02:52 UTC (rev 4116) @@ -23,6 +23,11 @@ assert test.question == test_question assert test.answer == test_answer - TestPickle._connection.cache.clear() - test = TestPickle.get(test.id, connection=TestPickle._connection) + connection = TestPickle._connection + if (connection.dbName == 'sqlite') and connection._memory: + return # The following test requires a different connection + + test = TestPickle.get(test.id, + connection=getConnection(registry='')) # to make a different DB URI + # and open another connection raises(pickle.PicklingError, pickle.dumps, test, pickle.HIGHEST_PROTOCOL) |
From: <sub...@co...> - 2010-02-26 21:27:35
|
Author: phd Date: 2010-02-26 14:27:29 -0700 (Fri, 26 Feb 2010) New Revision: 4110 Modified: SQLObject/trunk/docs/News.txt SQLObject/trunk/sqlobject/main.py SQLObject/trunk/sqlobject/tests/test_select.py Log: Merged revisions 4107, 4108 from branch 0.11: fixed a comment; do not set _perConnection flag if get() or _init() is passed the same connection; this is often the case with select(). Modified: SQLObject/trunk/docs/News.txt =================================================================== --- SQLObject/trunk/docs/News.txt 2010-02-26 21:27:07 UTC (rev 4109) +++ SQLObject/trunk/docs/News.txt 2010-02-26 21:27:29 UTC (rev 4110) @@ -97,6 +97,9 @@ connection is not a transaction and is in autocommit mode - remove parent row(s). +* Do not set _perConnection flag if get() or _init() is passed the same + connection; this is often the case with select(). + SQLObject 0.11.3 ================ Modified: SQLObject/trunk/sqlobject/main.py =================================================================== --- SQLObject/trunk/sqlobject/main.py 2010-02-26 21:27:07 UTC (rev 4109) +++ SQLObject/trunk/sqlobject/main.py 2010-02-26 21:27:29 UTC (rev 4110) @@ -768,7 +768,7 @@ # Do not check hasattr(cls, '_connection') here - it is possible # SQLObject parent class has a connection attribute that came - # from sqlhub, e.g.; # check __dict__ only. + # from sqlhub, e.g.; check __dict__ only. if connection and ('_connection' not in cls.__dict__): cls.setConnection(connection) @@ -921,7 +921,7 @@ # If no connection was given, we'll inherit the class # instance variable which should have a _connection # attribute. - if connection is not None: + if (connection is not None) and (self._connection != connection): self._connection = connection # Sometimes we need to know if this instance is # global or tied to a particular connection. @@ -1207,9 +1207,10 @@ # Pass the connection object along if we were given one. if kw.has_key('connection'): - self._connection = kw['connection'] - self.sqlmeta._perConnection = True - del kw['connection'] + connection = kw.pop('connection') + if self._connection != connection: + self._connection = connection + self.sqlmeta._perConnection = True self._SO_writeLock = threading.Lock() Modified: SQLObject/trunk/sqlobject/tests/test_select.py =================================================================== --- SQLObject/trunk/sqlobject/tests/test_select.py 2010-02-26 21:27:07 UTC (rev 4109) +++ SQLObject/trunk/sqlobject/tests/test_select.py 2010-02-26 21:27:29 UTC (rev 4110) @@ -189,3 +189,8 @@ setupClass(IterTest) IterTest(name='sqlobject') IterTest.select(IterTest.q.name==u'sqlobject') + +def test_select_perConnection(): + setupClass(IterTest) + IterTest(name='a') + assert not IterTest.select().getOne().sqlmeta._perConnection |
From: <sub...@co...> - 2010-02-26 21:27:13
|
Author: phd Date: 2010-02-26 14:27:07 -0700 (Fri, 26 Feb 2010) New Revision: 4109 Modified: SQLObject/branches/0.12/docs/News.txt SQLObject/branches/0.12/sqlobject/main.py SQLObject/branches/0.12/sqlobject/tests/test_select.py Log: Merged revisions 4107, 4108 from branch 0.11: fixed a comment; do not set _perConnection flag if get() or _init() is passed the same connection; this is often the case with select(). Modified: SQLObject/branches/0.12/docs/News.txt =================================================================== --- SQLObject/branches/0.12/docs/News.txt 2010-02-26 21:25:26 UTC (rev 4108) +++ SQLObject/branches/0.12/docs/News.txt 2010-02-26 21:27:07 UTC (rev 4109) @@ -78,6 +78,9 @@ connection is not a transaction and is in autocommit mode - remove parent row(s). +* Do not set _perConnection flag if get() or _init() is passed the same + connection; this is often the case with select(). + SQLObject 0.11.3 ================ Modified: SQLObject/branches/0.12/sqlobject/main.py =================================================================== --- SQLObject/branches/0.12/sqlobject/main.py 2010-02-26 21:25:26 UTC (rev 4108) +++ SQLObject/branches/0.12/sqlobject/main.py 2010-02-26 21:27:07 UTC (rev 4109) @@ -768,7 +768,7 @@ # Do not check hasattr(cls, '_connection') here - it is possible # SQLObject parent class has a connection attribute that came - # from sqlhub, e.g.; # check __dict__ only. + # from sqlhub, e.g.; check __dict__ only. if connection and ('_connection' not in cls.__dict__): cls.setConnection(connection) @@ -920,7 +920,7 @@ # If no connection was given, we'll inherit the class # instance variable which should have a _connection # attribute. - if connection is not None: + if (connection is not None) and (self._connection != connection): self._connection = connection # Sometimes we need to know if this instance is # global or tied to a particular connection. @@ -1206,9 +1206,10 @@ # Pass the connection object along if we were given one. if kw.has_key('connection'): - self._connection = kw['connection'] - self.sqlmeta._perConnection = True - del kw['connection'] + connection = kw.pop('connection') + if self._connection != connection: + self._connection = connection + self.sqlmeta._perConnection = True self._SO_writeLock = threading.Lock() Modified: SQLObject/branches/0.12/sqlobject/tests/test_select.py =================================================================== --- SQLObject/branches/0.12/sqlobject/tests/test_select.py 2010-02-26 21:25:26 UTC (rev 4108) +++ SQLObject/branches/0.12/sqlobject/tests/test_select.py 2010-02-26 21:27:07 UTC (rev 4109) @@ -189,3 +189,8 @@ setupClass(IterTest) IterTest(name='sqlobject') IterTest.select(IterTest.q.name==u'sqlobject') + +def test_select_perConnection(): + setupClass(IterTest) + IterTest(name='a') + assert not IterTest.select().getOne().sqlmeta._perConnection |