sqlobject-cvs Mailing List for SQLObject (Page 52)
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: <sub...@co...> - 2009-12-31 01:53:13
|
Author: phd Date: 2009-12-30 18:35:47 -0700 (Wed, 30 Dec 2009) New Revision: 4065 Modified: SQLObject/branches/0.12/docs/News.txt SQLObject/branches/0.12/sqlobject/postgres/pgconnection.py Log: Fixed a bug in PostgresConnection. Modified: SQLObject/branches/0.12/docs/News.txt =================================================================== --- SQLObject/branches/0.12/docs/News.txt 2009-12-31 01:26:42 UTC (rev 4064) +++ SQLObject/branches/0.12/docs/News.txt 2009-12-31 01:35:47 UTC (rev 4065) @@ -10,7 +10,7 @@ SQLObject 0.12.1 ================ -* Fixed a bug in PostgresConnection. +* Fixed two bugs in PostgresConnection. * A change ported from `SQLObject 0.11.3`_. Modified: SQLObject/branches/0.12/sqlobject/postgres/pgconnection.py =================================================================== --- SQLObject/branches/0.12/sqlobject/postgres/pgconnection.py 2009-12-31 01:26:42 UTC (rev 4064) +++ SQLObject/branches/0.12/sqlobject/postgres/pgconnection.py 2009-12-31 01:35:47 UTC (rev 4065) @@ -99,7 +99,7 @@ self.unicodeCols = unicodeCols self.schema = kw.pop('schema', None) if "charset" in kw: - self.dbEncoding = self.kw["charset"] = kw.pop("charset") + self.dbEncoding = kw.pop("charset") else: self.dbEncoding = None DBAPI.__init__(self, **kw) |
From: SourceForge.net <no...@so...> - 2009-12-31 01:36:51
|
Bugs item #2923946, was opened at 2009-12-31 04:04 Message generated for change (Settings changed) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=2923946&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: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: dkeeney (dvkeeney) >Assigned to: Oleg Broytman (phd) Summary: reference to nonexistent attribute Initial Comment: The __init__ method of PostgresConnection has this line sequence near the end: if "charset" in kw: self.dbEncoding = self.kw["charset"] = kw.pop("charset") The self.kw attribute does not exist, so if a 'charset' keyword param is provided, the init crashes. ---------------------------------------------------------------------- >Comment By: Oleg Broytman (phd) Date: 2009-12-31 04:36 Message: Fixed in r4065. Thank you! ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=2923946&group_id=74338 |
From: <sub...@co...> - 2009-12-31 01:26:53
|
Author: phd Date: 2009-12-30 18:26:42 -0700 (Wed, 30 Dec 2009) New Revision: 4064 Modified: SQLObject/trunk/docs/News.txt SQLObject/trunk/sqlobject/firebird/firebirdconnection.py SQLObject/trunk/sqlobject/postgres/pgconnection.py Log: Merged bugfixed from revision 4063. Modified: SQLObject/trunk/docs/News.txt =================================================================== --- SQLObject/trunk/docs/News.txt 2009-12-31 01:18:05 UTC (rev 4063) +++ SQLObject/trunk/docs/News.txt 2009-12-31 01:26:42 UTC (rev 4064) @@ -10,6 +10,13 @@ SQLObject (trunk) ================= +SQLObject 0.12.1 +================ + +* Fixed a bug in PostgresConnection. + +* A change ported from `SQLObject 0.11.3`_. + SQLObject 0.12 ============== @@ -63,6 +70,8 @@ SQLObject 0.11.3 ================ +* Fixed a bug in FirebirdConnection. + * A change ported from `SQLObject 0.10.9`_. SQLObject 0.11.2 Modified: SQLObject/trunk/sqlobject/firebird/firebirdconnection.py =================================================================== --- SQLObject/trunk/sqlobject/firebird/firebirdconnection.py 2009-12-31 01:18:05 UTC (rev 4063) +++ SQLObject/trunk/sqlobject/firebird/firebirdconnection.py 2009-12-31 01:26:42 UTC (rev 4064) @@ -9,14 +9,14 @@ dbName = 'firebird' schemes = [dbName] + limit_re = re.compile('^\s*(select )(.*)', re.IGNORECASE) + def __init__(self, host, db, user='sysdba', password='masterkey', autoCommit=1, dialect=None, role=None, charset=None, **kw): import kinterbasdb self.module = kinterbasdb - self.limit_re = re.compile('^\s*(select )(.*)', re.IGNORECASE) - self.host = host self.db = db self.user = user Modified: SQLObject/trunk/sqlobject/postgres/pgconnection.py =================================================================== --- SQLObject/trunk/sqlobject/postgres/pgconnection.py 2009-12-31 01:18:05 UTC (rev 4063) +++ SQLObject/trunk/sqlobject/postgres/pgconnection.py 2009-12-31 01:26:42 UTC (rev 4064) @@ -13,7 +13,7 @@ def __init__(self, dsn=None, host=None, port=None, db=None, user=None, password=None, backend='psycopg', unicodeCols=False, **kw): - backends = kw.pop('backend', None) or 'psycopg' + backends = backend for backend in backends.split(','): backend = backend.strip() if not backend: |
From: SourceForge.net <no...@so...> - 2009-12-31 01:22:39
|
Patches item #2883211, was opened at 2009-10-21 17:10 Message generated for change (Settings changed) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=2883211&group_id=74338 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None >Status: Closed >Resolution: Invalid Priority: 5 Private: No Submitted By: Matt Domsch (mdomsch) Assigned to: Nobody/Anonymous (nobody) Summary: executing scripts with sqlite backend Initial Comment: When trying to execute a multi-line sql script using sqlobject-admin upgrade, sqlobject fails Traceback (most recent call last): File "/usr/bin/tg-admin", line 8, in <module> load_entry_point('TurboGears==1.0.8', 'console_scripts', 'tg-admin')() File "/usr/lib/python2.5/site-packages/turbogears/command/base.py", line 400, in main command.run() File "/usr/lib/python2.5/site-packages/turbogears/command/base.py", line 138, in run command.the_runner.run(sys.argv) File "/usr/lib/python2.5/site-packages/sqlobject/manager/command.py", line 101, in run runner.run() File "/usr/lib/python2.5/site-packages/sqlobject/manager/command.py", line 307, in run self.command() File "/usr/lib/python2.5/site-packages/sqlobject/manager/command.py", line 1191, in command conn.query(sql) File "/usr/lib/python2.5/site-packages/sqlobject/dbconnection.py", line 337, in query return self._runWithConnection(self._query, s) File "/usr/lib/python2.5/site-packages/sqlobject/dbconnection.py", line 250, in _runWithConnection val = meth(conn, *args) File "/usr/lib/python2.5/site-packages/sqlobject/dbconnection.py", line 334, in _query self._executeRetry(conn, conn.cursor(), s) File "/usr/lib/python2.5/site-packages/sqlobject/sqlite/sqliteconnection.py", line 197, in _executeRetry raise Warning(ErrorMessage(e)) sqlobject.dberrors.Warning: You can only execute one statement at a time. However, for updating database schemas, I need to be able to execute more than one statement at a time. Patch attached looks at the query string for multiple lines, and if so, calls executescript() instead of execute(). ---------------------------------------------------------------------- Comment By: Oleg Broytman (phd) Date: 2009-12-14 21:50 Message: I am not sure how to accept the patch. First, shouldn't SQL statements be separated by a semicolon (';'), not a eoln? Second, isn't SQLiteConnection too low-level for the patch? Shouldn't it be fixed somewhere higher so any backend can accept mutlistatment script? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=2883211&group_id=74338 |
From: SourceForge.net <no...@so...> - 2009-12-31 01:19:42
|
Bugs item #2923940, was opened at 2009-12-31 03:56 Message generated for change (Comment added) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=2923940&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: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: dkeeney (dvkeeney) >Assigned to: Oleg Broytman (phd) Summary: backend param not handled correctly Initial Comment: When a 'backend' parameter is passed to the PostgresConnection __init__, it is ignored. from postgres/pgconnection.py : This first line in __init__, backends = kw.pop('backend', None) or 'psycopg' should be like: backends = backend or 'psycopg' or just: backends = backend since the backend param has a default value of 'psycopg'. ---------------------------------------------------------------------- >Comment By: Oleg Broytman (phd) Date: 2009-12-31 04:19 Message: You are right. backends = backend is enough. Fixed in the revision 4062, will be in the next round of releases. Thank you! ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=2923940&group_id=74338 |
From: <sub...@co...> - 2009-12-31 01:18:17
|
Author: phd Date: 2009-12-30 18:18:05 -0700 (Wed, 30 Dec 2009) New Revision: 4063 Modified: SQLObject/branches/0.12/docs/News.txt SQLObject/branches/0.12/sqlobject/firebird/firebirdconnection.py Log: A bugfix for FirebirdConnection merged from r4060-r4061. Modified: SQLObject/branches/0.12/docs/News.txt =================================================================== --- SQLObject/branches/0.12/docs/News.txt 2009-12-31 01:12:37 UTC (rev 4062) +++ SQLObject/branches/0.12/docs/News.txt 2009-12-31 01:18:05 UTC (rev 4063) @@ -7,6 +7,13 @@ .. _start: +SQLObject 0.12.1 +================ + +* Fixed a bug in PostgresConnection. + +* A change ported from `SQLObject 0.11.3`_. + SQLObject 0.12.0 ================ @@ -60,6 +67,8 @@ SQLObject 0.11.3 ================ +* Fixed a bug in FirebirdConnection. + * A change ported from `SQLObject 0.10.9`_. SQLObject 0.11.2 Modified: SQLObject/branches/0.12/sqlobject/firebird/firebirdconnection.py =================================================================== --- SQLObject/branches/0.12/sqlobject/firebird/firebirdconnection.py 2009-12-31 01:12:37 UTC (rev 4062) +++ SQLObject/branches/0.12/sqlobject/firebird/firebirdconnection.py 2009-12-31 01:18:05 UTC (rev 4063) @@ -9,14 +9,14 @@ dbName = 'firebird' schemes = [dbName] + limit_re = re.compile('^\s*(select )(.*)', re.IGNORECASE) + def __init__(self, host, db, user='sysdba', password='masterkey', autoCommit=1, dialect=None, role=None, charset=None, **kw): import kinterbasdb self.module = kinterbasdb - self.limit_re = re.compile('^\s*(select )(.*)', re.IGNORECASE) - self.host = host self.db = db self.user = user |
From: <sub...@co...> - 2009-12-31 01:12:51
|
Author: phd Date: 2009-12-30 18:12:37 -0700 (Wed, 30 Dec 2009) New Revision: 4062 Modified: SQLObject/branches/0.12/sqlobject/postgres/pgconnection.py Log: Fixed a bug in PostgresConnection. Modified: SQLObject/branches/0.12/sqlobject/postgres/pgconnection.py =================================================================== --- SQLObject/branches/0.12/sqlobject/postgres/pgconnection.py 2009-12-31 01:10:00 UTC (rev 4061) +++ SQLObject/branches/0.12/sqlobject/postgres/pgconnection.py 2009-12-31 01:12:37 UTC (rev 4062) @@ -13,7 +13,7 @@ def __init__(self, dsn=None, host=None, port=None, db=None, user=None, password=None, backend='psycopg', unicodeCols=False, **kw): - backends = kw.pop('backend', None) or 'psycopg' + backends = backend for backend in backends.split(','): backend = backend.strip() if not backend: |
From: <sub...@co...> - 2009-12-31 01:10:13
|
Author: phd Date: 2009-12-30 18:10:00 -0700 (Wed, 30 Dec 2009) New Revision: 4061 Modified: SQLObject/branches/0.11/docs/News.txt Log: Documentation update. Modified: SQLObject/branches/0.11/docs/News.txt =================================================================== --- SQLObject/branches/0.11/docs/News.txt 2009-12-31 01:08:54 UTC (rev 4060) +++ SQLObject/branches/0.11/docs/News.txt 2009-12-31 01:10:00 UTC (rev 4061) @@ -10,6 +10,8 @@ SQLObject 0.11.3 ================ +* Fixed a bug in FirebirdConnection. + * A change ported from `SQLObject 0.10.9`_. SQLObject 0.11.2 |
From: <sub...@co...> - 2009-12-31 01:09:07
|
Author: phd Date: 2009-12-30 18:08:54 -0700 (Wed, 30 Dec 2009) New Revision: 4060 Modified: SQLObject/branches/0.11/sqlobject/firebird/firebirdconnection.py Log: Fixed a bug. Modified: SQLObject/branches/0.11/sqlobject/firebird/firebirdconnection.py =================================================================== --- SQLObject/branches/0.11/sqlobject/firebird/firebirdconnection.py 2009-12-14 19:23:26 UTC (rev 4059) +++ SQLObject/branches/0.11/sqlobject/firebird/firebirdconnection.py 2009-12-31 01:08:54 UTC (rev 4060) @@ -10,6 +10,8 @@ dbName = 'firebird' schemes = [dbName] + limit_re = re.compile('^\s*(select )(.*)', re.IGNORECASE) + def __init__(self, host, db, user='sysdba', password='masterkey', autoCommit=1, dialect=None, role=None, charset=None, **kw): @@ -18,8 +20,6 @@ import kinterbasdb self.module = kinterbasdb - self.limit_re = re.compile('^\s*(select )(.*)', re.IGNORECASE) - self.host = host self.db = db self.user = user |
From: SourceForge.net <no...@so...> - 2009-12-31 01:04:03
|
Bugs item #2923946, was opened at 2009-12-30 19:04 Message generated for change (Tracker Item Submitted) made by dvkeeney You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=2923946&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: dkeeney (dvkeeney) Assigned to: Nobody/Anonymous (nobody) Summary: reference to nonexistent attribute Initial Comment: The __init__ method of PostgresConnection has this line sequence near the end: if "charset" in kw: self.dbEncoding = self.kw["charset"] = kw.pop("charset") The self.kw attribute does not exist, so if a 'charset' keyword param is provided, the init crashes. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=2923946&group_id=74338 |
From: SourceForge.net <no...@so...> - 2009-12-31 00:56:30
|
Bugs item #2923940, was opened at 2009-12-30 18:56 Message generated for change (Tracker Item Submitted) made by dvkeeney You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=2923940&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: dkeeney (dvkeeney) Assigned to: Nobody/Anonymous (nobody) Summary: backend param not handled correctly Initial Comment: When a 'backend' parameter is passed to the PostgresConnection __init__, it is ignored. from postgres/pgconnection.py : This first line in __init__, backends = kw.pop('backend', None) or 'psycopg' should be like: backends = backend or 'psycopg' or just: backends = backend since the backend param has a default value of 'psycopg'. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=2923940&group_id=74338 |
From: <sub...@co...> - 2009-12-14 19:53:13
|
Author: phd Date: 2009-12-14 12:23:26 -0700 (Mon, 14 Dec 2009) New Revision: 4059 Removed: SQLObject/trunk/docs/sqlobject-architecture.txt Modified: SQLObject/trunk/docs/FAQ.txt SQLObject/trunk/docs/index.txt SQLObject/trunk/docs/rebuild SQLObject/trunk/setup.cfg Log: Moved text from sqlobject-architecture.txt to the FAQ; removed sqlobject-architecture.txt. Modified: SQLObject/trunk/docs/FAQ.txt =================================================================== --- SQLObject/trunk/docs/FAQ.txt 2009-11-08 00:08:13 UTC (rev 4058) +++ SQLObject/trunk/docs/FAQ.txt 2009-12-14 19:23:26 UTC (rev 4059) @@ -4,6 +4,48 @@ .. contents:: +SQLExpression +------------- + +In `SomeTable.select(SomeTable.q.Foo > 30)` why doesn't the inner parameter, +`SomeTable.q.Foo > 30`, get evaluated to some boolean value? + +`q` is an object that returns special attributes of type +`sqlbuilder.SQLExpression`. SQLExpression is a special class that overrides +almost all Python magic methods and upon any operation instead of +evaluating it constructs another instance of SQLExpression that remembers +what operation it has to do. Similar to a symbolic algebra. Example: + + SQLExpression("foo") > 30 + +produces SQLExpression("foo", ">", 30) (well, it really produces +SQLExpression(SQLExpression("foo")...)) + +How does the select(...) method know what to do? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +In short, select() recursively evaluates the top-most SQLExpression to a +string: + + SQLExpression("foo", ">", 30) => "foo > 30" + +and passes the result as a string to the SQL backend. + +The longer but more detailed and correct explanation is that select() +produces an instance of SelectResults_ class that upon being iterated over +produces an instance of Iteration class that upon calling its next() +method (it is iterator!) construct the SQL query string, passes it to the +backend, fetches the results, wraps every row as SQLObject instance and +passes them back to the user. + +.. _SelectResults: SelectResults.html + +For the details of the implementation see sqlobject/main.py for SQLObject, +sqlobject/sqlbuilder.py for SQLExpression, sqlobject/dbconnection.py for +DBConnection class (that constructs the query strings) and Iteration class, +and different subdirectories of sqlobject for concrete implementations of +connection classes - different backends require different query strings. + Why there is no __len__? ------------------------ Modified: SQLObject/trunk/docs/index.txt =================================================================== --- SQLObject/trunk/docs/index.txt 2009-11-08 00:08:13 UTC (rev 4058) +++ SQLObject/trunk/docs/index.txt 2009-12-14 19:23:26 UTC (rev 4059) @@ -22,7 +22,6 @@ * `Frequently Asked Questions <FAQ.html>`_ * `sqlbuilder documentation <SQLBuilder.html>`_ * `select() and SelectResults <SelectResults.html>`_ -* `A brief description of SQLObject architecture <sqlobject-architecture.html>`_ * `sqlobject-admin documentation <sqlobject-admin.html>`_ * `Inheritance <Inheritance.html>`_ * `Versioning <Versioning.html>`_ Modified: SQLObject/trunk/docs/rebuild =================================================================== --- SQLObject/trunk/docs/rebuild 2009-11-08 00:08:13 UTC (rev 4058) +++ SQLObject/trunk/docs/rebuild 2009-12-14 19:23:26 UTC (rev 4059) @@ -7,7 +7,7 @@ NORMAL="Authors DeveloperGuide FAQ Inheritance News SQLBuilder SQLObject SelectResults TODO Versioning Views - community download index links sqlobject-admin sqlobject-architecture" + community download index links sqlobject-admin" for NAME in $NORMAL ; do if [ -e "$NAME.html" -a ! "$NAME.html" -ot "$NAME.txt" ] ; then Deleted: SQLObject/trunk/docs/sqlobject-architecture.txt =================================================================== --- SQLObject/trunk/docs/sqlobject-architecture.txt 2009-11-08 00:08:13 UTC (rev 4058) +++ SQLObject/trunk/docs/sqlobject-architecture.txt 2009-12-14 19:23:26 UTC (rev 4059) @@ -1,44 +0,0 @@ -| > SomeTable.select(SomeTable.q.Foo > 30) -| > -| > Why doesn't the inner parameter, SomeTable.q.Foo > 30, get evaluated to some boolean value? - -.q is an object that returns special attributes of type -sqlbuilder.SQLExpression. SQLExpression is a special class that overrides -almost all Python magic methods and upon any operation instead of -evaluating it constructs another instance of SQLExpression that remembers -what operation it has to do. A kind of symbolic algebra. Example: - - SQLExpression("foo") > 30 - -produces SQLExpression("foo", ">", 30) (well, it really produces -SQLExpression(SQLExpression("foo")...)) - -| > How does the select(...) method know what to do? - -In short, .select() recursively evaluates the top-most SQLExpression to a -string: - - SQLExpression("foo", ">", 30) => "foo > 30" - -and passes the result as a string to the SQL backend. - -The longer but more detailed and correct explanation is that .select() -produces an instance of SelectResults class that upon being iterated over -produces an instance of Iteration class that upon calling its .next() -method (it is iterator!) construct the SQL query string, passes it to the -backend, fetches the results, wraps every row as SQLObject instance and -passes them back to the user. - -For the details of the implementation see sqlobject/main.py for SQLObject, -sqlobject/sqlbuilder.py for SQLExpression, sqlobject/dbconnection.py for -DBConnection class (that constructs the query strings) and Iteration class, -and different subdirectories of sqlobject for concrete implementations of -connection classes - different backends require different query strings. - -.. image:: http://sflogo.sourceforge.net/sflogo.php?group_id=74338&type=10 - :target: http://sourceforge.net/projects/sqlobject - :class: noborder - :align: center - :height: 15 - :width: 80 - :alt: Get SQLObject at SourceForge.net. Fast, secure and Free Open Source software downloads Modified: SQLObject/trunk/setup.cfg =================================================================== --- SQLObject/trunk/setup.cfg 2009-11-08 00:08:13 UTC (rev 4058) +++ SQLObject/trunk/setup.cfg 2009-12-14 19:23:26 UTC (rev 4059) @@ -15,7 +15,7 @@ docs/Inheritance.txt docs/News.txt docs/SQLBuilder.txt docs/SQLObject.txt docs/SelectResults.txt docs/TODO.txt docs/Versioning.txt docs/Views.txt docs/community.txt docs/download.txt - docs/links.txt docs/sqlobject-admin.txt docs/sqlobject-architecture.txt + docs/links.txt docs/sqlobject-admin.txt doc_base = docs/ dest = docs/html modules = sqlobject |
From: SourceForge.net <no...@so...> - 2009-12-14 18:50:37
|
Patches item #2883211, was opened at 2009-10-21 17:10 Message generated for change (Comment added) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=2883211&group_id=74338 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Matt Domsch (mdomsch) Assigned to: Nobody/Anonymous (nobody) Summary: executing scripts with sqlite backend Initial Comment: When trying to execute a multi-line sql script using sqlobject-admin upgrade, sqlobject fails Traceback (most recent call last): File "/usr/bin/tg-admin", line 8, in <module> load_entry_point('TurboGears==1.0.8', 'console_scripts', 'tg-admin')() File "/usr/lib/python2.5/site-packages/turbogears/command/base.py", line 400, in main command.run() File "/usr/lib/python2.5/site-packages/turbogears/command/base.py", line 138, in run command.the_runner.run(sys.argv) File "/usr/lib/python2.5/site-packages/sqlobject/manager/command.py", line 101, in run runner.run() File "/usr/lib/python2.5/site-packages/sqlobject/manager/command.py", line 307, in run self.command() File "/usr/lib/python2.5/site-packages/sqlobject/manager/command.py", line 1191, in command conn.query(sql) File "/usr/lib/python2.5/site-packages/sqlobject/dbconnection.py", line 337, in query return self._runWithConnection(self._query, s) File "/usr/lib/python2.5/site-packages/sqlobject/dbconnection.py", line 250, in _runWithConnection val = meth(conn, *args) File "/usr/lib/python2.5/site-packages/sqlobject/dbconnection.py", line 334, in _query self._executeRetry(conn, conn.cursor(), s) File "/usr/lib/python2.5/site-packages/sqlobject/sqlite/sqliteconnection.py", line 197, in _executeRetry raise Warning(ErrorMessage(e)) sqlobject.dberrors.Warning: You can only execute one statement at a time. However, for updating database schemas, I need to be able to execute more than one statement at a time. Patch attached looks at the query string for multiple lines, and if so, calls executescript() instead of execute(). ---------------------------------------------------------------------- >Comment By: Oleg Broytman (phd) Date: 2009-12-14 21:50 Message: I am not sure how to accept the patch. First, shouldn't SQL statements be separated by a semicolon (';'), not a eoln? Second, isn't SQLiteConnection too low-level for the patch? Shouldn't it be fixed somewhere higher so any backend can accept mutlistatment script? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=2883211&group_id=74338 |
From: <sub...@co...> - 2009-10-22 17:41:02
|
Author: phd Date: 2009-10-22 11:40:46 -0600 (Thu, 22 Oct 2009) New Revision: 4047 Modified: SQLObject/trunk/docs/News.txt Log: attributes Modified: SQLObject/trunk/docs/News.txt =================================================================== --- SQLObject/trunk/docs/News.txt 2009-10-22 17:39:38 UTC (rev 4046) +++ SQLObject/trunk/docs/News.txt 2009-10-22 17:40:46 UTC (rev 4047) @@ -56,7 +56,7 @@ in global variables; this allows to use different DB API drivers at the same time; for example, PySQLite2 and sqlite3. -* Removed all deprecated attribute and functions. +* Removed all deprecated attributes and functions. * Removed the last remained string exceptions. |
From: <sub...@co...> - 2009-10-22 17:39:47
|
Author: phd Date: 2009-10-22 11:39:38 -0600 (Thu, 22 Oct 2009) New Revision: 4046 Modified: SQLObject/branches/0.12/docs/News.txt Log: attributes Modified: SQLObject/branches/0.12/docs/News.txt =================================================================== --- SQLObject/branches/0.12/docs/News.txt 2009-10-20 13:55:02 UTC (rev 4045) +++ SQLObject/branches/0.12/docs/News.txt 2009-10-22 17:39:38 UTC (rev 4046) @@ -53,7 +53,7 @@ in global variables; this allows to use different DB API drivers at the same time; for example, PySQLite2 and sqlite3. -* Removed all deprecated attribute and functions. +* Removed all deprecated attributes and functions. * Removed the last remained string exceptions. |
From: SourceForge.net <no...@so...> - 2009-10-21 13:10:03
|
Patches item #2883211, was opened at 2009-10-21 08:10 Message generated for change (Tracker Item Submitted) made by mdomsch You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=2883211&group_id=74338 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Matt Domsch (mdomsch) Assigned to: Nobody/Anonymous (nobody) Summary: executing scripts with sqlite backend Initial Comment: When trying to execute a multi-line sql script using sqlobject-admin upgrade, sqlobject fails Traceback (most recent call last): File "/usr/bin/tg-admin", line 8, in <module> load_entry_point('TurboGears==1.0.8', 'console_scripts', 'tg-admin')() File "/usr/lib/python2.5/site-packages/turbogears/command/base.py", line 400, in main command.run() File "/usr/lib/python2.5/site-packages/turbogears/command/base.py", line 138, in run command.the_runner.run(sys.argv) File "/usr/lib/python2.5/site-packages/sqlobject/manager/command.py", line 101, in run runner.run() File "/usr/lib/python2.5/site-packages/sqlobject/manager/command.py", line 307, in run self.command() File "/usr/lib/python2.5/site-packages/sqlobject/manager/command.py", line 1191, in command conn.query(sql) File "/usr/lib/python2.5/site-packages/sqlobject/dbconnection.py", line 337, in query return self._runWithConnection(self._query, s) File "/usr/lib/python2.5/site-packages/sqlobject/dbconnection.py", line 250, in _runWithConnection val = meth(conn, *args) File "/usr/lib/python2.5/site-packages/sqlobject/dbconnection.py", line 334, in _query self._executeRetry(conn, conn.cursor(), s) File "/usr/lib/python2.5/site-packages/sqlobject/sqlite/sqliteconnection.py", line 197, in _executeRetry raise Warning(ErrorMessage(e)) sqlobject.dberrors.Warning: You can only execute one statement at a time. However, for updating database schemas, I need to be able to execute more than one statement at a time. Patch attached looks at the query string for multiple lines, and if so, calls executescript() instead of execute(). ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=2883211&group_id=74338 |
From: <sub...@co...> - 2009-10-20 13:55:22
|
Author: phd Date: 2009-10-20 07:55:02 -0600 (Tue, 20 Oct 2009) New Revision: 4045 Modified: SQLObject/tags/0.12.0/setup.cfg SQLObject/tags/0.12.0/setup.py SQLObject/tags/0.12.0/sqlobject/__init__.py SQLObject/tags/0.12.0/sqlobject/main.py Log: Stable version 0.12.0. Modified: SQLObject/tags/0.12.0/setup.cfg =================================================================== --- SQLObject/tags/0.12.0/setup.cfg 2009-10-20 13:53:49 UTC (rev 4044) +++ SQLObject/tags/0.12.0/setup.cfg 2009-10-20 13:55:02 UTC (rev 4045) @@ -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.0/setup.py =================================================================== --- SQLObject/tags/0.12.0/setup.py 2009-10-20 13:53:49 UTC (rev 4044) +++ SQLObject/tags/0.12.0/setup.py 2009-10-20 13:55:02 UTC (rev 4045) @@ -21,7 +21,7 @@ """ setup(name="SQLObject", - version="0.12", + version="0.12.0", description="Object-Relational Manager, aka database wrapper", long_description="""\ SQLObject is a popular *Object Relational Manager* for providing an Modified: SQLObject/tags/0.12.0/sqlobject/__init__.py =================================================================== --- SQLObject/tags/0.12.0/sqlobject/__init__.py 2009-10-20 13:53:49 UTC (rev 4044) +++ SQLObject/tags/0.12.0/sqlobject/__init__.py 2009-10-20 13:55:02 UTC (rev 4045) @@ -1,5 +1,5 @@ """ -SQLObject 0.12 +SQLObject 0.12.0 """ from col import * Modified: SQLObject/tags/0.12.0/sqlobject/main.py =================================================================== --- SQLObject/tags/0.12.0/sqlobject/main.py 2009-10-20 13:53:49 UTC (rev 4044) +++ SQLObject/tags/0.12.0/sqlobject/main.py 2009-10-20 13:55:02 UTC (rev 4045) @@ -1,6 +1,6 @@ """ -SQLObject 0.12 --------------- +SQLObject 0.12.0 +---------------- :author: Ian Bicking <ia...@co...> |
From: <sub...@co...> - 2009-10-20 13:54:01
|
Author: phd Date: 2009-10-20 07:53:49 -0600 (Tue, 20 Oct 2009) New Revision: 4044 Added: SQLObject/tags/0.12.0/ Log: Tagging 0.12.0 Copied: SQLObject/tags/0.12.0 (from rev 4043, SQLObject/branches/0.12) |
From: <sub...@co...> - 2009-10-20 13:53:29
|
Author: phd Date: 2009-10-20 07:53:16 -0600 (Tue, 20 Oct 2009) New Revision: 4043 Modified: SQLObject/trunk/docs/News.txt Log: SQLObject 0.12.0 was released 20 Oct 2009. Modified: SQLObject/trunk/docs/News.txt =================================================================== --- SQLObject/trunk/docs/News.txt 2009-10-20 13:50:56 UTC (rev 4042) +++ SQLObject/trunk/docs/News.txt 2009-10-20 13:53:16 UTC (rev 4043) @@ -13,6 +13,8 @@ SQLObject 0.12 ============== +Released 20 Oct 2009. + Features & Interface -------------------- @@ -66,21 +68,21 @@ SQLObject 0.11.2 ================ -Released 30 Sep 2009 +Released 30 Sep 2009. * A number of changes ported from `SQLObject 0.10.8`_. SQLObject 0.11.1 ================ -Released 20 Sep 2009 +Released 20 Sep 2009. * A number of changes ported from `SQLObject 0.10.7`_. SQLObject 0.11.0 ================ -Released 12 Aug 2009 +Released 12 Aug 2009. Features & Interface -------------------- @@ -135,7 +137,7 @@ SQLObject 0.10.8 ================ -Released 30 Sep 2009 +Released 30 Sep 2009. * Fixed a bug in logging to console - convert unicode to str. @@ -145,7 +147,7 @@ SQLObject 0.10.7 ================ -Released 20 Sep 2009 +Released 20 Sep 2009. * Fixed a bug: Sybase tables with identity column fire two identity_inserts. @@ -156,7 +158,7 @@ SQLObject 0.10.6 ================ -Released 18 May 2009 +Released 18 May 2009. * Better support for Python 2.6: do not import the deprecated sets module. @@ -165,7 +167,7 @@ SQLObject 0.10.5 ================ -Released 6 May 2009 +Released 6 May 2009. * A number of changes ported from `SQLObject 0.9.10`_. @@ -275,7 +277,7 @@ SQLObject 0.9.11 ================ -Released 18 May 2009 +Released 18 May 2009. * Two bugs in SQLiteConnection.columnsFromSchema() were fixed: use sqlmeta.idName instead of 'id'; convert default 'NULL' to None. @@ -288,7 +290,7 @@ SQLObject 0.9.10 ================ -Released 6 May 2009 +Released 6 May 2009. * Another unicode-related patch for MySQL; required because different versions of MySQLdb require different handling:: |
From: <sub...@co...> - 2009-10-20 13:51:10
|
Author: phd Date: 2009-10-20 07:50:56 -0600 (Tue, 20 Oct 2009) New Revision: 4042 Modified: SQLObject/branches/0.12/docs/News.txt Log: SQLObject 0.12.0 released 20 Oct 2009. Modified: SQLObject/branches/0.12/docs/News.txt =================================================================== --- SQLObject/branches/0.12/docs/News.txt 2009-10-20 13:49:47 UTC (rev 4041) +++ SQLObject/branches/0.12/docs/News.txt 2009-10-20 13:50:56 UTC (rev 4042) @@ -10,6 +10,8 @@ SQLObject 0.12.0 ================ +Released 20 Oct 2009. + Features & Interface -------------------- @@ -63,21 +65,21 @@ SQLObject 0.11.2 ================ -Released 30 Sep 2009 +Released 30 Sep 2009. * A number of changes ported from `SQLObject 0.10.8`_. SQLObject 0.11.1 ================ -Released 20 Sep 2009 +Released 20 Sep 2009. * A number of changes ported from `SQLObject 0.10.7`_. SQLObject 0.11.0 ================ -Released 12 Aug 2009 +Released 12 Aug 2009. Features & Interface -------------------- @@ -132,7 +134,7 @@ SQLObject 0.10.8 ================ -Released 30 Sep 2009 +Released 30 Sep 2009. * Fixed a bug in logging to console - convert unicode to str. @@ -142,7 +144,7 @@ SQLObject 0.10.7 ================ -Released 20 Sep 2009 +Released 20 Sep 2009. * Fixed a bug: Sybase tables with identity column fire two identity_inserts. @@ -153,7 +155,7 @@ SQLObject 0.10.6 ================ -Released 18 May 2009 +Released 18 May 2009. * Better support for Python 2.6: do not import the deprecated sets module. @@ -162,7 +164,7 @@ SQLObject 0.10.5 ================ -Released 6 May 2009 +Released 6 May 2009. * A number of changes ported from `SQLObject 0.9.10`_. @@ -272,7 +274,7 @@ SQLObject 0.9.11 ================ -Released 18 May 2009 +Released 18 May 2009. * Two bugs in SQLiteConnection.columnsFromSchema() were fixed: use sqlmeta.idName instead of 'id'; convert default 'NULL' to None. @@ -285,7 +287,7 @@ SQLObject 0.9.10 ================ -Released 6 May 2009 +Released 6 May 2009. * Another unicode-related patch for MySQL; required because different versions of MySQLdb require different handling:: |
From: <sub...@co...> - 2009-10-20 13:49:59
|
Author: phd Date: 2009-10-20 07:49:47 -0600 (Tue, 20 Oct 2009) New Revision: 4041 Modified: SQLObject/branches/0.11/docs/News.txt Log: Dots. Modified: SQLObject/branches/0.11/docs/News.txt =================================================================== --- SQLObject/branches/0.11/docs/News.txt 2009-10-16 12:51:21 UTC (rev 4040) +++ SQLObject/branches/0.11/docs/News.txt 2009-10-20 13:49:47 UTC (rev 4041) @@ -15,21 +15,21 @@ SQLObject 0.11.2 ================ -Released 30 Sep 2009 +Released 30 Sep 2009. * A number of changes ported from `SQLObject 0.10.8`_. SQLObject 0.11.1 ================ -Released 20 Sep 2009 +Released 20 Sep 2009. * A number of changes ported from `SQLObject 0.10.7`_. SQLObject 0.11.0 ================ -Released 12 Aug 2009 +Released 12 Aug 2009. Features & Interface -------------------- @@ -84,7 +84,7 @@ SQLObject 0.10.8 ================ -Released 30 Sep 2009 +Released 30 Sep 2009. * Fixed a bug in logging to console - convert unicode to str. @@ -94,7 +94,7 @@ SQLObject 0.10.7 ================ -Released 20 Sep 2009 +Released 20 Sep 2009. * Fixed a bug: Sybase tables with identity column fire two identity_inserts. @@ -105,7 +105,7 @@ SQLObject 0.10.6 ================ -Released 18 May 2009 +Released 18 May 2009. * Better support for Python 2.6: do not import the deprecated sets module. @@ -114,7 +114,7 @@ SQLObject 0.10.5 ================ -Released 6 May 2009 +Released 6 May 2009. * A number of changes ported from `SQLObject 0.9.10`_. @@ -224,7 +224,7 @@ SQLObject 0.9.11 ================ -Released 18 May 2009 +Released 18 May 2009. * Two bugs in SQLiteConnection.columnsFromSchema() were fixed: use sqlmeta.idName instead of 'id'; convert default 'NULL' to None. @@ -237,7 +237,7 @@ SQLObject 0.9.10 ================ -Released 6 May 2009 +Released 6 May 2009. * Another unicode-related patch for MySQL; required because different versions of MySQLdb require different handling:: |
From: <sub...@co...> - 2009-10-16 12:51:33
|
Author: phd Date: 2009-10-16 06:51:21 -0600 (Fri, 16 Oct 2009) New Revision: 4040 Modified: SQLObject/tags/0.12.0b2/setup.cfg SQLObject/tags/0.12.0b2/setup.py SQLObject/tags/0.12.0b2/sqlobject/__init__.py SQLObject/tags/0.12.0b2/sqlobject/main.py Log: Version 0.12.0b2. Modified: SQLObject/tags/0.12.0b2/setup.cfg =================================================================== --- SQLObject/tags/0.12.0b2/setup.cfg 2009-10-16 12:46:41 UTC (rev 4039) +++ SQLObject/tags/0.12.0b2/setup.cfg 2009-10-16 12:51:21 UTC (rev 4040) @@ -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.0b2/setup.py =================================================================== --- SQLObject/tags/0.12.0b2/setup.py 2009-10-16 12:46:41 UTC (rev 4039) +++ SQLObject/tags/0.12.0b2/setup.py 2009-10-16 12:51:21 UTC (rev 4040) @@ -21,7 +21,7 @@ """ setup(name="SQLObject", - version="0.12", + version="0.12.0b2", description="Object-Relational Manager, aka database wrapper", long_description="""\ SQLObject is a popular *Object Relational Manager* for providing an Modified: SQLObject/tags/0.12.0b2/sqlobject/__init__.py =================================================================== --- SQLObject/tags/0.12.0b2/sqlobject/__init__.py 2009-10-16 12:46:41 UTC (rev 4039) +++ SQLObject/tags/0.12.0b2/sqlobject/__init__.py 2009-10-16 12:51:21 UTC (rev 4040) @@ -1,5 +1,5 @@ """ -SQLObject 0.12 +SQLObject 0.12.0b2 """ from col import * Modified: SQLObject/tags/0.12.0b2/sqlobject/main.py =================================================================== --- SQLObject/tags/0.12.0b2/sqlobject/main.py 2009-10-16 12:46:41 UTC (rev 4039) +++ SQLObject/tags/0.12.0b2/sqlobject/main.py 2009-10-16 12:51:21 UTC (rev 4040) @@ -1,6 +1,6 @@ """ -SQLObject 0.12 --------------- +SQLObject 0.12.0b2 +------------------ :author: Ian Bicking <ia...@co...> |
From: <sub...@co...> - 2009-10-16 12:46:53
|
Author: phd Date: 2009-10-16 06:46:41 -0600 (Fri, 16 Oct 2009) New Revision: 4039 Added: SQLObject/tags/0.12.0b2/ Log: Tagging 0.12.0b2 Copied: SQLObject/tags/0.12.0b2 (from rev 4038, SQLObject/branches/0.12) |
From: <sub...@co...> - 2009-10-16 12:43:45
|
Author: phd Date: 2009-10-16 06:43:33 -0600 (Fri, 16 Oct 2009) New Revision: 4038 Modified: SQLObject/trunk/sqlobject/main.py SQLObject/trunk/sqlobject/sqlbuilder.py SQLObject/trunk/sqlobject/tests/test_select.py Log: Merged revision 4037 from branch 0.12: fixed a bug in calling column.from_python. Modified: SQLObject/trunk/sqlobject/main.py =================================================================== --- SQLObject/trunk/sqlobject/main.py 2009-10-16 12:40:05 UTC (rev 4037) +++ SQLObject/trunk/sqlobject/main.py 2009-10-16 12:43:33 UTC (rev 4038) @@ -889,7 +889,7 @@ if val is None: try: val = cls(_SO_fetch_no_create=1) - val._SO_validatorState = SQLObjectState(val) + val._SO_validatorState = sqlbuilder.SQLObjectState(val) val._init(id, connection, selectResults) cache.put(id, cls, val) finally: @@ -1237,7 +1237,7 @@ self.sqlmeta._creating = True self._SO_createValues = {} - self._SO_validatorState = SQLObjectState(self) + self._SO_validatorState = sqlbuilder.SQLObjectState(self) # First we do a little fix-up on the keywords we were # passed: @@ -1686,13 +1686,6 @@ return '_SO_val_%s' % name -class SQLObjectState(object): - - def __init__(self, soObject): - self.soObject = weakref.proxy(soObject) - self.protocol = 'sql' - - ######################################## ## Utility functions (for external consumption) ######################################## Modified: SQLObject/trunk/sqlobject/sqlbuilder.py =================================================================== --- SQLObject/trunk/sqlobject/sqlbuilder.py 2009-10-16 12:40:05 UTC (rev 4037) +++ SQLObject/trunk/sqlobject/sqlbuilder.py 2009-10-16 12:43:33 UTC (rev 4038) @@ -62,19 +62,28 @@ ## Constants ######################################## +import fnmatch +import operator +import re +import threading +import types +import weakref + +import classregistry +from converters import sqlrepr, registerConverter + + class VersionError(Exception): pass class NoDefault: pass -import re, fnmatch -import operator -import threading -import types -import classregistry -from converters import sqlrepr, registerConverter +class SQLObjectState(object): + def __init__(self, soObject): + self.soObject = weakref.proxy(soObject) + safeSQLRE = re.compile(r'^[a-zA-Z_][a-zA-Z0-9_\.]*$') def sqlIdentifier(obj): # some db drivers return unicode column names @@ -329,7 +338,7 @@ def _from_python(self, value): column = self.column if not isinstance(value, SQLExpression) and column and column.from_python: - value = column.from_python(value, self.soClass) + value = column.from_python(value, SQLObjectState(self.soClass)) return value def __eq__(self, other): if other is None: Modified: SQLObject/trunk/sqlobject/tests/test_select.py =================================================================== --- SQLObject/trunk/sqlobject/tests/test_select.py 2009-10-16 12:40:05 UTC (rev 4037) +++ SQLObject/trunk/sqlobject/tests/test_select.py 2009-10-16 12:43:33 UTC (rev 4038) @@ -184,3 +184,8 @@ assert IterTest.select(RLIKE(IterTest.q.name, "^sqlb.*$")).count() == 1 assert IterTest.select(RLIKE(IterTest.q.name, "^sqlb.*$")).count() == 1 assert IterTest.select(RLIKE(IterTest.q.name, "^sqlx.*$")).count() == 0 + +def test_select_sqlbuilder(): + setupClass(IterTest) + IterTest(name='sqlobject') + IterTest.select(IterTest.q.name==u'sqlobject') |
From: <sub...@co...> - 2009-10-16 12:40:17
|
Author: phd Date: 2009-10-16 06:40:05 -0600 (Fri, 16 Oct 2009) New Revision: 4037 Modified: SQLObject/branches/0.12/sqlobject/main.py SQLObject/branches/0.12/sqlobject/sqlbuilder.py SQLObject/branches/0.12/sqlobject/tests/test_select.py Log: Fixed a bug in calling column.from_python. Modified: SQLObject/branches/0.12/sqlobject/main.py =================================================================== --- SQLObject/branches/0.12/sqlobject/main.py 2009-10-16 12:35:22 UTC (rev 4036) +++ SQLObject/branches/0.12/sqlobject/main.py 2009-10-16 12:40:05 UTC (rev 4037) @@ -889,7 +889,7 @@ if val is None: try: val = cls(_SO_fetch_no_create=1) - val._SO_validatorState = SQLObjectState(val) + val._SO_validatorState = sqlbuilder.SQLObjectState(val) val._init(id, connection, selectResults) cache.put(id, cls, val) finally: @@ -1237,7 +1237,7 @@ self.sqlmeta._creating = True self._SO_createValues = {} - self._SO_validatorState = SQLObjectState(self) + self._SO_validatorState = sqlbuilder.SQLObjectState(self) # First we do a little fix-up on the keywords we were # passed: @@ -1686,13 +1686,6 @@ return '_SO_val_%s' % name -class SQLObjectState(object): - - def __init__(self, soObject): - self.soObject = weakref.proxy(soObject) - self.protocol = 'sql' - - ######################################## ## Utility functions (for external consumption) ######################################## Modified: SQLObject/branches/0.12/sqlobject/sqlbuilder.py =================================================================== --- SQLObject/branches/0.12/sqlobject/sqlbuilder.py 2009-10-16 12:35:22 UTC (rev 4036) +++ SQLObject/branches/0.12/sqlobject/sqlbuilder.py 2009-10-16 12:40:05 UTC (rev 4037) @@ -62,19 +62,28 @@ ## Constants ######################################## +import fnmatch +import operator +import re +import threading +import types +import weakref + +import classregistry +from converters import sqlrepr, registerConverter + + class VersionError(Exception): pass class NoDefault: pass -import re, fnmatch -import operator -import threading -import types -import classregistry -from converters import sqlrepr, registerConverter +class SQLObjectState(object): + def __init__(self, soObject): + self.soObject = weakref.proxy(soObject) + safeSQLRE = re.compile(r'^[a-zA-Z_][a-zA-Z0-9_\.]*$') def sqlIdentifier(obj): # some db drivers return unicode column names @@ -329,7 +338,7 @@ def _from_python(self, value): column = self.column if not isinstance(value, SQLExpression) and column and column.from_python: - value = column.from_python(value, self.soClass) + value = column.from_python(value, SQLObjectState(self.soClass)) return value def __eq__(self, other): if other is None: Modified: SQLObject/branches/0.12/sqlobject/tests/test_select.py =================================================================== --- SQLObject/branches/0.12/sqlobject/tests/test_select.py 2009-10-16 12:35:22 UTC (rev 4036) +++ SQLObject/branches/0.12/sqlobject/tests/test_select.py 2009-10-16 12:40:05 UTC (rev 4037) @@ -184,3 +184,8 @@ assert IterTest.select(RLIKE(IterTest.q.name, "^sqlb.*$")).count() == 1 assert IterTest.select(RLIKE(IterTest.q.name, "^sqlb.*$")).count() == 1 assert IterTest.select(RLIKE(IterTest.q.name, "^sqlx.*$")).count() == 0 + +def test_select_sqlbuilder(): + setupClass(IterTest) + IterTest(name='sqlobject') + IterTest.select(IterTest.q.name==u'sqlobject') |