sqlobject-cvs Mailing List for SQLObject (Page 69)
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
(9) |
Apr
(74) |
May
(29) |
Jun
(16) |
Jul
(28) |
Aug
(10) |
Sep
(57) |
Oct
(9) |
Nov
(29) |
Dec
(12) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(7) |
Feb
(14) |
Mar
(6) |
Apr
(3) |
May
(12) |
Jun
(34) |
Jul
(9) |
Aug
(29) |
Sep
(22) |
Oct
(2) |
Nov
(15) |
Dec
(52) |
| 2005 |
Jan
(47) |
Feb
(78) |
Mar
(14) |
Apr
(35) |
May
(33) |
Jun
(16) |
Jul
(26) |
Aug
(63) |
Sep
(40) |
Oct
(96) |
Nov
(96) |
Dec
(123) |
| 2006 |
Jan
(159) |
Feb
(144) |
Mar
(64) |
Apr
(31) |
May
(88) |
Jun
(48) |
Jul
(16) |
Aug
(64) |
Sep
(87) |
Oct
(92) |
Nov
(56) |
Dec
(76) |
| 2007 |
Jan
(94) |
Feb
(103) |
Mar
(126) |
Apr
(123) |
May
(85) |
Jun
(11) |
Jul
(130) |
Aug
(47) |
Sep
(65) |
Oct
(70) |
Nov
(12) |
Dec
(11) |
| 2008 |
Jan
(30) |
Feb
(55) |
Mar
(88) |
Apr
(20) |
May
(50) |
Jun
|
Jul
(38) |
Aug
(1) |
Sep
(9) |
Oct
(5) |
Nov
(6) |
Dec
(39) |
| 2009 |
Jan
(8) |
Feb
(16) |
Mar
(3) |
Apr
(33) |
May
(44) |
Jun
(1) |
Jul
(10) |
Aug
(33) |
Sep
(74) |
Oct
(22) |
Nov
|
Dec
(15) |
| 2010 |
Jan
(28) |
Feb
(22) |
Mar
(46) |
Apr
(29) |
May
(1) |
Jun
(1) |
Jul
(27) |
Aug
(8) |
Sep
(5) |
Oct
(33) |
Nov
(24) |
Dec
(41) |
| 2011 |
Jan
(4) |
Feb
(12) |
Mar
(35) |
Apr
(29) |
May
(19) |
Jun
(16) |
Jul
(32) |
Aug
(25) |
Sep
(5) |
Oct
(11) |
Nov
(21) |
Dec
(12) |
| 2012 |
Jan
(3) |
Feb
(4) |
Mar
(20) |
Apr
(4) |
May
(25) |
Jun
(13) |
Jul
|
Aug
|
Sep
(2) |
Oct
(25) |
Nov
(9) |
Dec
(1) |
| 2013 |
Jan
(6) |
Feb
(8) |
Mar
|
Apr
(10) |
May
(31) |
Jun
(7) |
Jul
(18) |
Aug
(33) |
Sep
(4) |
Oct
(16) |
Nov
|
Dec
(27) |
| 2014 |
Jan
(2) |
Feb
|
Mar
|
Apr
(11) |
May
(39) |
Jun
(8) |
Jul
(11) |
Aug
(4) |
Sep
|
Oct
(27) |
Nov
|
Dec
(71) |
| 2015 |
Jan
(17) |
Feb
(47) |
Mar
(33) |
Apr
|
May
|
Jun
(9) |
Jul
(7) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(8) |
| 2016 |
Jan
(4) |
Feb
(4) |
Mar
|
Apr
|
May
(12) |
Jun
(7) |
Jul
(9) |
Aug
(31) |
Sep
(8) |
Oct
(3) |
Nov
(15) |
Dec
(1) |
| 2017 |
Jan
(13) |
Feb
(7) |
Mar
(14) |
Apr
(8) |
May
(10) |
Jun
(4) |
Jul
(2) |
Aug
(1) |
Sep
|
Oct
(8) |
Nov
(4) |
Dec
(5) |
| 2018 |
Jan
(2) |
Feb
(8) |
Mar
|
Apr
(4) |
May
|
Jun
(6) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2019 |
Jan
(1) |
Feb
(16) |
Mar
(1) |
Apr
(3) |
May
(5) |
Jun
(1) |
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
(1) |
Dec
(3) |
| 2020 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(1) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
(2) |
Nov
|
Dec
(2) |
| 2021 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(1) |
Dec
|
| 2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(6) |
Oct
(1) |
Nov
(1) |
Dec
(4) |
| 2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(3) |
Sep
(2) |
Oct
(2) |
Nov
(4) |
Dec
|
| 2024 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(9) |
| 2025 |
Jan
|
Feb
(4) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
(2) |
Dec
(2) |
|
From: <sub...@co...> - 2008-04-14 14:38:13
|
Author: phd
Date: 2008-04-14 08:37:53 -0600 (Mon, 14 Apr 2008)
New Revision: 3381
Modified:
SQLObject/branches/0.10/docs/News.txt
SQLObject/branches/0.10/sqlobject/declarative.py
Log:
Reverted the patch N 1407684 (declarative.threadSafeMethod()) - it causes more harm then good.
Modified: SQLObject/branches/0.10/docs/News.txt
===================================================================
--- SQLObject/branches/0.10/docs/News.txt 2008-04-14 14:32:42 UTC (rev 3380)
+++ SQLObject/branches/0.10/docs/News.txt 2008-04-14 14:37:53 UTC (rev 3381)
@@ -84,6 +84,9 @@
* A minor bug was fixed in col.py - the registry must be passed to findClass().
+* Reverted the patch declarative.threadSafeMethod() - it causes more harm
+ then good.
+
SQLObject 0.9.5
===============
@@ -442,9 +445,6 @@
* Fixed a bug with default field values for columns for Firebird connection.
-* Prevent a deadlock in declarative.threadSafeMethod() by not reacquiring
- the class lock.
-
* Fixed a bug in col.createSQL().
* Fixed a bug in converting date/time for years < 1000 (time.strptime()
Modified: SQLObject/branches/0.10/sqlobject/declarative.py
===================================================================
--- SQLObject/branches/0.10/sqlobject/declarative.py 2008-04-14 14:32:42 UTC (rev 3380)
+++ SQLObject/branches/0.10/sqlobject/declarative.py 2008-04-14 14:37:53 UTC (rev 3381)
@@ -32,16 +32,15 @@
or an instance method depending on where it is called.
"""
-import threading
+import copy
import events
-__all__ = ('classinstancemethod', 'DeclarativeMeta', 'Declarative')
-
-import copy
-
import itertools
counter = itertools.count()
+__all__ = ('classinstancemethod', 'DeclarativeMeta', 'Declarative')
+
+
class classinstancemethod(object):
"""
Acts like a class method when called from a class, like an
@@ -77,25 +76,6 @@
return ('<bound method %s.%s of %r>'
% (self.type.__name__, self.func.func_name, self.obj))
-def threadSafeMethod(lock):
- def decorator(fn):
- def _wrapper(self, *args, **kwargs):
- # This prevents deadlocks.
- # The class lock isn't really needed in __init__() while fetching.
- if '_SO_fetch_no_create' in kwargs:
- return fn(self, *args, **kwargs)
- lock.acquire()
- try:
- return fn(self, *args, **kwargs)
- finally:
- lock.release()
- try:
- _wrapper.func_name = fn.func_name
- except TypeError:
- pass
- return _wrapper
- return decorator
-
class DeclarativeMeta(type):
def __new__(meta, class_name, bases, new_attrs):
@@ -110,9 +90,6 @@
if new_attrs.has_key('__classinit__'):
cls.__classinit__ = staticmethod(cls.__classinit__.im_func)
cls.__classinit__(cls, new_attrs)
- if new_attrs.has_key('__init__'):
- lock = threading.RLock()
- cls.__init__ = threadSafeMethod(lock)(cls.__init__)
for func in post_funcs:
func(cls)
return cls
|
|
From: SourceForge.net <no...@so...> - 2008-04-14 14:33:36
|
Patches item #1407684, was opened at 2006-01-17 00:35 Message generated for change (Comment added) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1407684&group_id=74338 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Closed >Resolution: Invalid Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Oleg Broytmann (phd) Summary: object initialization threading issue Initial Comment: The creation of SQL objects is not threadsafe. After stressing a TurboGears app with ab2 with multiple concurrent connections to a threaded server, the log gets filled with tracebacks like these: 15/Jan/2006:22:05:00 HTTP INFO Traceback (most recent call last): File "/usr/lib/python2.4/site-packages/CherryPy-2.2.0beta-py2.4.egg/ cherrypy/_cp httptools.py", line 96, in _run applyFilters('before_main') File "/usr/lib/python2.4/site-packages/CherryPy-2.2.0beta-py2.4.egg/ cherrypy/fil ters/__init__.py", line 131, in applyFilters method() File "/home/alberto/turbogears/turbogears/visit.py", line 99, in beforeMain visit=self.get_visit() File "/home/alberto/turbogears/turbogears/visit.py", line 139, in get_visit return self.new_visit() File "/home/alberto/turbogears/turbogears/visit.py", line 122, in new_visit visit= TG_Visit( visit_key=visit_key, expiry=now+self.timeout ) File "/usr/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1500- py2.4.egg/sqlobj ect/main.py", line 1197, in __init__ self._create(id, **kw) File "/usr/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1500- py2.4.egg/sqlobj ect/main.py", line 1221, in _create self.set(**kw) File "/usr/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1500- py2.4.egg/sqlobj ect/main.py", line 1142, in set self._connection._SO_update(self, args) File "/usr/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1500- py2.4.egg/sqlobj ect/dbconnection.py", line 561, in _SO_update self.query("UPDATE %s SET %s WHERE %s = %s" % AttributeError: 'TG_Visit' object has no attribute 'id' 15/Jan/2006:22:05:00 HTTP INFO Traceback (most recent call last): File "/usr/lib/python2.4/site-packages/CherryPy-2.2.0beta-py2.4.egg/ cherrypy/_cp httptools.py", line 96, in _run applyFilters('before_main') File "/usr/lib/python2.4/site-packages/CherryPy-2.2.0beta-py2.4.egg/ cherrypy/fil ters/__init__.py", line 131, in applyFilters method() File "/home/alberto/turbogears/turbogears/visit.py", line 99, in beforeMain visit=self.get_visit() File "/home/alberto/turbogears/turbogears/visit.py", line 139, in get_visit return self.new_visit() File "/home/alberto/turbogears/turbogears/visit.py", line 122, in new_visit visit= TG_Visit( visit_key=visit_key, expiry=now+self.timeout ) File "/usr/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1500- py2.4.egg/sqlobj ect/main.py", line 1197, in __init__ self._create(id, **kw) File "/usr/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1500- py2.4.egg/sqlobj ect/main.py", line 1224, in _create self._SO_finishCreate(id) File "/usr/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1500- py2.4.egg/sqlobj ect/main.py", line 1242, in _SO_finishCreate del self.sqlmeta._creating AttributeError: _creating I've found at http://pythonpaste.org/archives/message/ 20051202.223718.a3adcfaa.en.html a solution to the problem, which is overriding __init__ on SQLObject subclasses by wrapping SQLObject.__init__ with a mutex acquisition and release. I've made a patch for main.py which generalizes this approach and wraps __init__ for every SQLObject created. Tested under my environment and works fine. The patch is also posted at the turbogears Trac at http:// trac.turbogears.org/turbogears/attachment/ticket/397/ sqlobject_threading.patch Cheers, Alberto Valverde al...@to... ---------------------------------------------------------------------- >Comment By: Oleg Broytmann (phd) Date: 2008-04-14 18:33 Message: Logged In: YES user_id=4799 Originator: NO I reverted the patch due to the bug report at http://groups.google.com/group/turbogears/msg/2b056e15ed3af886 ---------------------------------------------------------------------- Comment By: Jeremy Field (j3z) Date: 2007-12-22 06:07 Message: Logged In: YES user_id=932673 Originator: NO I think I am experiencing this or a similar problem in SQLObject 0.9.2. I've written a simple SQLObject subclass (A) within a fairly straightforward schema. It fails to instantiate, giving the error partially reproduced below. Interestingly, it has only started to fail since I added another SQLObject subclass (B) to the schema. This second subclass has a many-to-one relationship to the first, and was inserted between (A) and a third subclass (C) as follows: Before: A -one-to-many-> C After: A -one-to-many-> B -one-to-many-> C I have to assume that this rearrangement is what's causing the problem, but can't for the life of me work out why! The problem occurs running a procedural script from the command line, so I don't see how threading could be the problem. Traceback (most recent call last): ... File "/usr/lib/python2.4/site-packages/sqlobject/declarative.py", line 98, in _wrapper return fn(self, *args, **kwargs) File "/usr/lib/python2.4/site-packages/sqlobject/main.py", line 1210, in __init__ self._create(id, **kw) File "/usr/lib/python2.4/site-packages/sqlobject/main.py", line 1238, in _create self.set(**kw) File "<string>", line 1, in <lambda> File "/usr/lib/python2.4/site-packages/sqlobject/main.py", line 975, in _SO_loadValue selectResults = self._connection._SO_selectOne(self, dbNames) File "/usr/lib/python2.4/site-packages/sqlobject/dbconnection.py", line 652, in _SO_selectOne return self.queryOne( AttributeError: 'A' object has no attribute 'id' I can provide more details if anyone can suggest where I should start. (Have already spent considerable time in the debugger, but have been unable to work out what's failing.) ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2006-01-30 23:21 Message: Logged In: YES user_id=4799 Applied at the revision 1546. Thank you! ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2006-01-17 00:39 Message: Logged In: NO Ooops, typo: the patch is for declarative.py, not main.py ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1407684&group_id=74338 |
|
From: <sub...@co...> - 2008-04-14 14:33:12
|
Author: phd
Date: 2008-04-14 08:32:42 -0600 (Mon, 14 Apr 2008)
New Revision: 3380
Modified:
SQLObject/branches/0.9/docs/News.txt
SQLObject/branches/0.9/sqlobject/declarative.py
Log:
Reverted the patch N 1407684 (declarative.threadSafeMethod()) - it causes more harm then good.
Modified: SQLObject/branches/0.9/docs/News.txt
===================================================================
--- SQLObject/branches/0.9/docs/News.txt 2008-04-13 00:55:25 UTC (rev 3379)
+++ SQLObject/branches/0.9/docs/News.txt 2008-04-14 14:32:42 UTC (rev 3380)
@@ -14,6 +14,9 @@
* A minor bug was fixed in col.py - the registry must be passed to findClass().
+* Reverted the patch declarative.threadSafeMethod() - it causes more harm
+ then good.
+
SQLObject 0.9.5
===============
@@ -376,9 +379,6 @@
* Fixed a bug with default field values for columns for Firebird connection.
-* Prevent a deadlock in declarative.threadSafeMethod() by not reacquiring
- the class lock.
-
* Fixed a bug in col.createSQL().
* Fixed a bug in converting date/time for years < 1000 (time.strptime()
Modified: SQLObject/branches/0.9/sqlobject/declarative.py
===================================================================
--- SQLObject/branches/0.9/sqlobject/declarative.py 2008-04-13 00:55:25 UTC (rev 3379)
+++ SQLObject/branches/0.9/sqlobject/declarative.py 2008-04-14 14:32:42 UTC (rev 3380)
@@ -33,12 +33,11 @@
"""
from __future__ import generators
-import threading
+import copy
import events
__all__ = ('classinstancemethod', 'DeclarativeMeta', 'Declarative')
-import copy
try:
import itertools
@@ -86,25 +85,6 @@
return ('<bound method %s.%s of %r>'
% (self.type.__name__, self.func.func_name, self.obj))
-def threadSafeMethod(lock):
- def decorator(fn):
- def _wrapper(self, *args, **kwargs):
- # This prevents deadlocks.
- # The class lock isn't really needed in __init__() while fetching.
- if '_SO_fetch_no_create' in kwargs:
- return fn(self, *args, **kwargs)
- lock.acquire()
- try:
- return fn(self, *args, **kwargs)
- finally:
- lock.release()
- try:
- _wrapper.func_name = fn.func_name
- except TypeError:
- pass
- return _wrapper
- return decorator
-
class DeclarativeMeta(type):
def __new__(meta, class_name, bases, new_attrs):
@@ -119,9 +99,6 @@
if new_attrs.has_key('__classinit__'):
cls.__classinit__ = staticmethod(cls.__classinit__.im_func)
cls.__classinit__(cls, new_attrs)
- if new_attrs.has_key('__init__'):
- lock = threading.RLock()
- cls.__init__ = threadSafeMethod(lock)(cls.__init__)
for func in post_funcs:
func(cls)
return cls
|
|
From: SourceForge.net <no...@so...> - 2008-04-10 12:51:41
|
Bugs item #1839646, was opened at 2007-11-27 17:33 Message generated for change (Comment added) made by psr You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1839646&group_id=74338 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: General Group: SQLObject release (specify) Status: Closed Resolution: Accepted Priority: 5 Private: No Submitted By: Peter Russell (psr) Assigned to: Oleg Broytmann (phd) Summary: SQLObject instances of same class with same ID should be == Initial Comment: I've got a failing unittest in some code where I assert that: group in member.groups where Group and Member are InheritableSQLObject classes, related by a RelatedJoin. The test loads group and member, then calls the "add a member to a group" controller of my web app, to add the member to the group. The assertion fails despite the controller working correctly, because SQLObject doesn't override __eq__ to ensure that two different python instances pointing at the same row are equal. Presumably adding the following to the definition of SQLObject would work def __eq__(self, other): if self.__class__ == other.__class__: if self.id == other.id: return True return False This is occuring with an SQLite in-memory database, with SQLObject 0.7.7 (I know I should upgrade!) ---------------------------------------------------------------------- Comment By: Peter Russell (psr) Date: 2008-04-10 12:51 Message: Logged In: YES user_id=447903 Originator: YES Thanks Oleg, that's brilliant! ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2007-12-26 12:33 Message: Logged In: YES user_id=4799 Originator: NO Implemented in the trunk. I added all rich comparison methods and a test. Committed to the trunk at the revision 3184. Will be in SQLObject 0.10. Thank you! ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1839646&group_id=74338 |
|
From: <sub...@co...> - 2008-04-09 13:19:37
|
Author: phd
Date: 2008-04-09 07:19:11 -0600 (Wed, 09 Apr 2008)
New Revision: 3373
Modified:
SQLObject/trunk/docs/News.txt
SQLObject/trunk/sqlobject/firebird/firebirdconnection.py
SQLObject/trunk/sqlobject/mysql/mysqlconnection.py
SQLObject/trunk/sqlobject/postgres/pgconnection.py
SQLObject/trunk/sqlobject/sqlite/sqliteconnection.py
Log:
SQLObject can now create and drop a database in MySQL, PostgreSQL, SQLite and Firebird/Interbase.
Modified: SQLObject/trunk/docs/News.txt
===================================================================
--- SQLObject/trunk/docs/News.txt 2008-04-02 21:36:45 UTC (rev 3372)
+++ SQLObject/trunk/docs/News.txt 2008-04-09 13:19:11 UTC (rev 3373)
@@ -22,6 +22,9 @@
* New magic attribute 'j' similar to 'q' was added that automagically does
join with the other table in MultipleJoin or RelatedJoin.
+* SQLObject can now create and drop a database in MySQL, PostgreSQL, SQLite
+ and Firebird/Interbase.
+
Minor features
--------------
Modified: SQLObject/trunk/sqlobject/firebird/firebirdconnection.py
===================================================================
--- SQLObject/trunk/sqlobject/firebird/firebirdconnection.py 2008-04-02 21:36:45 UTC (rev 3372)
+++ SQLObject/trunk/sqlobject/firebird/firebirdconnection.py 2008-04-09 13:19:11 UTC (rev 3373)
@@ -226,3 +226,10 @@
return col.DateTimeCol, {}
else:
return col.Col, {}
+
+ def createEmptyDatabase(self):
+ self.module.create_database("CREATE DATABASE '%s' user '%s' password '%s'" % \
+ (self.db, self.user, self.password))
+
+ def dropDatabase(self):
+ self.module.drop_database()
Modified: SQLObject/trunk/sqlobject/mysql/mysqlconnection.py
===================================================================
--- SQLObject/trunk/sqlobject/mysql/mysqlconnection.py 2008-04-02 21:36:45 UTC (rev 3372)
+++ SQLObject/trunk/sqlobject/mysql/mysqlconnection.py 2008-04-09 13:19:11 UTC (rev 3373)
@@ -292,3 +292,12 @@
return col.StringCol, {"length": 2**32, "varchar": True}
else:
return col.Col, {}
+
+ def _createOrDropDatabase(self, op="CREATE"):
+ self.query('%s DATABASE %s' % (op, self.db))
+
+ def createEmptyDatabase(self):
+ self._createOrDropDatabase()
+
+ def dropDatabase(self):
+ self._createOrDropDatabase(op="DROP")
Modified: SQLObject/trunk/sqlobject/postgres/pgconnection.py
===================================================================
--- SQLObject/trunk/sqlobject/postgres/pgconnection.py 2008-04-02 21:36:45 UTC (rev 3372)
+++ SQLObject/trunk/sqlobject/postgres/pgconnection.py 2008-04-09 13:19:11 UTC (rev 3373)
@@ -292,7 +292,7 @@
return True
return getattr(sqlbuilder.const, defaultstr)
- def createEmptyDatabase(self):
+ def _createOrDropDatabase(self, op="CREATE"):
# We have to connect to *some* database, so we'll connect to
# template1, which is a common open database.
# @@: This doesn't use self.use_dsn or self.dsn_dict
@@ -312,11 +312,17 @@
# We must close the transaction with a commit so that
# the CREATE DATABASE can work (which can't be in a transaction):
cur.execute('COMMIT')
- cur.execute('CREATE DATABASE %s' % self.db)
+ cur.execute('%s DATABASE %s' % (op, self.db))
cur.close()
conn.close()
+ def createEmptyDatabase(self):
+ self._createOrDropDatabase()
+ def dropDatabase(self):
+ self._createOrDropDatabase(op="DROP")
+
+
# Converter for psycopg Binary type.
def PsycoBinaryConverter(value, db):
assert db == 'postgres'
Modified: SQLObject/trunk/sqlobject/sqlite/sqliteconnection.py
===================================================================
--- SQLObject/trunk/sqlobject/sqlite/sqliteconnection.py 2008-04-02 21:36:45 UTC (rev 3372)
+++ SQLObject/trunk/sqlobject/sqlite/sqliteconnection.py 2008-04-09 13:19:11 UTC (rev 3373)
@@ -1,8 +1,9 @@
import base64
+import os
+import thread
from sqlobject.dbconnection import DBAPI
from sqlobject import col, sqlbuilder
from sqlobject.dberrors import *
-import thread
sqlite = None
using_sqlite2 = False
@@ -357,5 +358,16 @@
else:
return col.Col, {}
+ def createEmptyDatabase(self):
+ if self._memory:
+ return
+ open(self.filename, 'w').close()
+
+ def dropDatabase(self):
+ if self._memory:
+ return
+ os.unlink(self.filename)
+
+
def stop_pysqlite2_converting_strings(s):
return s
|
|
From: <sub...@co...> - 2008-03-17 21:15:41
|
Author: phd
Date: 2008-03-17 15:15:38 -0600 (Mon, 17 Mar 2008)
New Revision: 3343
Modified:
SQLObject/trunk/sqlobject/sqlbuilder.py
SQLObject/trunk/sqlobject/tests/test_sqlbuilder_joins_instances.py
Log:
Removed trailing spaces.
Modified: SQLObject/trunk/sqlobject/sqlbuilder.py
===================================================================
--- SQLObject/trunk/sqlobject/sqlbuilder.py 2008-03-17 21:04:50 UTC (rev 3342)
+++ SQLObject/trunk/sqlobject/sqlbuilder.py 2008-03-17 21:15:38 UTC (rev 3343)
@@ -425,7 +425,7 @@
return self._getattrFromJoin(join, attr)
else:
return SQLObjectTable.__getattr__(self, attr)
-
+
def _getattrFromForeignKey(self, column, attr):
ret = getattr(self, column.name) == \
getattr(self.soClass, '_SO_class_'+column.foreignKey).q.id
Modified: SQLObject/trunk/sqlobject/tests/test_sqlbuilder_joins_instances.py
===================================================================
--- SQLObject/trunk/sqlobject/tests/test_sqlbuilder_joins_instances.py 2008-03-17 21:04:50 UTC (rev 3342)
+++ SQLObject/trunk/sqlobject/tests/test_sqlbuilder_joins_instances.py 2008-03-17 21:15:38 UTC (rev 3343)
@@ -56,7 +56,7 @@
assert list(SBAddress.select(AND(SBPerson.j.addresses, SBPerson.q.name=='Julia'))) == \
list(SBAddress.select(AND(SBPerson.q.id==SBAddress.q.personID, SBPerson.q.name=='Julia'))) == \
list(SBPerson.selectBy(name='Julia').throughTo.addresses)
-
+
def testFK2():
assert list(SBAddress.select(AND(SBAddress.j.person, SBPerson.q.name=='Julia'))) == \
list(SBAddress.select(AND(SBPerson.q.id==SBAddress.q.personID, SBPerson.q.name=='Julia')))
|
|
From: <sub...@co...> - 2008-03-17 21:04:56
|
Author: luke
Date: 2008-03-17 15:04:50 -0600 (Mon, 17 Mar 2008)
New Revision: 3342
Modified:
SQLObject/trunk/sqlobject/main.py
SQLObject/trunk/sqlobject/sqlbuilder.py
SQLObject/trunk/sqlobject/tests/test_sqlbuilder_joins_instances.py
Log:
.j attribute on SO classes, and sqlbuilder.SQLObjectTableWithJoins class for auto-constructing join expressions as 'cls.j.joinName' or 'cls.j.foreignKeyName'
Modified: SQLObject/trunk/sqlobject/main.py
===================================================================
--- SQLObject/trunk/sqlobject/main.py 2008-03-17 17:36:06 UTC (rev 3341)
+++ SQLObject/trunk/sqlobject/main.py 2008-03-17 21:04:50 UTC (rev 3342)
@@ -798,6 +798,7 @@
# more.
if not is_base:
cls.q = sqlbuilder.SQLObjectTable(cls)
+ cls.j = sqlbuilder.SQLObjectTableWithJoins(cls)
classregistry.registry(cls.sqlmeta.registry).addClass(cls)
Modified: SQLObject/trunk/sqlobject/sqlbuilder.py
===================================================================
--- SQLObject/trunk/sqlobject/sqlbuilder.py 2008-03-17 17:36:06 UTC (rev 3341)
+++ SQLObject/trunk/sqlobject/sqlbuilder.py 2008-03-17 21:04:50 UTC (rev 3342)
@@ -414,6 +414,30 @@
def _getattrFromUnicodeColumn(self, column, attr):
return self.UnicodeFieldClass(self.tableName, column.dbName, attr, column)
+class SQLObjectTableWithJoins(SQLObjectTable):
+
+ def __getattr__(self, attr):
+ if attr+'ID' in [k for (k,v) in self.soClass.sqlmeta.columns.items() if v.foreignKey]:
+ column = self.soClass.sqlmeta.columns[attr+'ID']
+ return self._getattrFromForeignKey(column, attr)
+ elif attr in [x.joinMethodName for x in self.soClass.sqlmeta.joins]:
+ join = [x for x in self.soClass.sqlmeta.joins if x.joinMethodName == attr][0]
+ return self._getattrFromJoin(join, attr)
+ else:
+ return SQLObjectTable.__getattr__(self, attr)
+
+ def _getattrFromForeignKey(self, column, attr):
+ ret = getattr(self, column.name) == \
+ getattr(self.soClass, '_SO_class_'+column.foreignKey).q.id
+ return ret
+
+ def _getattrFromJoin(self, join, attr):
+ if hasattr(join, 'otherColumn'):
+ return AND(join.otherClass.q.id == Field(join.intermediateTable, join.otherColumn),
+ Field(join.intermediateTable, join.joinColumn) == self.soClass.q.id)
+ else:
+ return getattr(join.otherClass.q, join.joinColumn)==self.soClass.q.id
+
class TableSpace:
TableClass = Table
Modified: SQLObject/trunk/sqlobject/tests/test_sqlbuilder_joins_instances.py
===================================================================
--- SQLObject/trunk/sqlobject/tests/test_sqlbuilder_joins_instances.py 2008-03-17 17:36:06 UTC (rev 3341)
+++ SQLObject/trunk/sqlobject/tests/test_sqlbuilder_joins_instances.py 2008-03-17 21:04:50 UTC (rev 3342)
@@ -43,3 +43,20 @@
def testInstance():
assert list(SBAddress.select(AND(SBPerson.q.id==SBAddress.q.personID, SBPerson.q.id==ppl[0].id))) == \
list(ppl[0].addresses)
+
+def testFK():
+ assert list(SBPerson.select(AND(SBAddress.j.person, SBAddress.q.city=='London'))) == \
+ list(SBPerson.select(AND(SBPerson.q.id==SBAddress.q.personID, SBAddress.q.city=='London')))
+
+def testRelatedJoin2():
+ assert list(SBAddress.select(AND(SBAddress.j.sharedPeople, SBPerson.q.name=='Julia'))) == \
+ list(SBPerson.select(SBPerson.q.name=='Julia').throughTo.sharedAddresses)
+
+def testJoin2():
+ assert list(SBAddress.select(AND(SBPerson.j.addresses, SBPerson.q.name=='Julia'))) == \
+ list(SBAddress.select(AND(SBPerson.q.id==SBAddress.q.personID, SBPerson.q.name=='Julia'))) == \
+ list(SBPerson.selectBy(name='Julia').throughTo.addresses)
+
+def testFK2():
+ assert list(SBAddress.select(AND(SBAddress.j.person, SBPerson.q.name=='Julia'))) == \
+ list(SBAddress.select(AND(SBPerson.q.id==SBAddress.q.personID, SBPerson.q.name=='Julia')))
|
|
From: <sub...@co...> - 2008-03-17 17:36:14
|
Author: phd
Date: 2008-03-17 11:36:06 -0600 (Mon, 17 Mar 2008)
New Revision: 3341
Modified:
SQLObject/trunk/docs/News.txt
SQLObject/trunk/sqlobject/col.py
Log:
A minor bug was fixed in col.py - the registry must be passed to findClass().
Modified: SQLObject/trunk/docs/News.txt
===================================================================
--- SQLObject/trunk/docs/News.txt 2008-03-17 17:35:45 UTC (rev 3340)
+++ SQLObject/trunk/docs/News.txt 2008-03-17 17:36:06 UTC (rev 3341)
@@ -96,6 +96,8 @@
* A bug in inheritable delColumn() that doesn't removes properties was fixed.
+* A minor bug was fixed in col.py - the registry must be passed to findClass().
+
SQLObject 0.9.5
===============
Modified: SQLObject/trunk/sqlobject/col.py
===================================================================
--- SQLObject/trunk/sqlobject/col.py 2008-03-17 17:35:45 UTC (rev 3340)
+++ SQLObject/trunk/sqlobject/col.py 2008-03-17 17:36:06 UTC (rev 3341)
@@ -773,7 +773,7 @@
def sqliteCreateSQL(self):
sql = SOKeyCol.sqliteCreateSQL(self)
- other = findClass(self.foreignKey)
+ other = findClass(self.foreignKey, self.soClass.sqlmeta.registry)
tName = other.sqlmeta.table
idName = other.sqlmeta.idName
if self.cascade is not None:
@@ -855,7 +855,7 @@
def sybaseCreateSQL(self):
sql = SOKeyCol.sybaseCreateSQL(self)
- other = findClass(self.foreignKey)
+ other = findClass(self.foreignKey, self.soClass.sqlmeta.registry)
tName = other.sqlmeta.table
idName = other.sqlmeta.idName
reference = ('REFERENCES %(tName)s(%(idName)s) ' %
@@ -870,7 +870,7 @@
def mssqlCreateSQL(self):
sql = SOKeyCol.mssqlCreateSQL(self)
- other = findClass(self.foreignKey)
+ other = findClass(self.foreignKey, self.soClass.sqlmeta.registry)
tName = other.sqlmeta.table
idName = other.sqlmeta.idName
reference = ('REFERENCES %(tName)s(%(idName)s) ' %
@@ -884,7 +884,7 @@
return None
def maxdbCreateSQL(self):
- other = findClass(self.foreignKey)
+ other = findClass(self.foreignKey, self.soClass.sqlmeta.registry)
fidName = self.dbName
#I assume that foreign key name is identical to the id of the reference table
sql = ' '.join([fidName, self._maxdbType()])
|
|
From: <sub...@co...> - 2008-03-17 17:35:51
|
Author: phd
Date: 2008-03-17 11:35:45 -0600 (Mon, 17 Mar 2008)
New Revision: 3340
Modified:
SQLObject/branches/0.10/docs/News.txt
SQLObject/branches/0.10/sqlobject/col.py
Log:
A minor bug was fixed in col.py - the registry must be passed to findClass().
Modified: SQLObject/branches/0.10/docs/News.txt
===================================================================
--- SQLObject/branches/0.10/docs/News.txt 2008-03-17 17:35:09 UTC (rev 3339)
+++ SQLObject/branches/0.10/docs/News.txt 2008-03-17 17:35:45 UTC (rev 3340)
@@ -82,6 +82,8 @@
* A bug in inheritable delColumn() that doesn't removes properties was fixed.
+* A minor bug was fixed in col.py - the registry must be passed to findClass().
+
SQLObject 0.9.5
===============
Modified: SQLObject/branches/0.10/sqlobject/col.py
===================================================================
--- SQLObject/branches/0.10/sqlobject/col.py 2008-03-17 17:35:09 UTC (rev 3339)
+++ SQLObject/branches/0.10/sqlobject/col.py 2008-03-17 17:35:45 UTC (rev 3340)
@@ -773,7 +773,7 @@
def sqliteCreateSQL(self):
sql = SOKeyCol.sqliteCreateSQL(self)
- other = findClass(self.foreignKey)
+ other = findClass(self.foreignKey, self.soClass.sqlmeta.registry)
tName = other.sqlmeta.table
idName = other.sqlmeta.idName
if self.cascade is not None:
@@ -855,7 +855,7 @@
def sybaseCreateSQL(self):
sql = SOKeyCol.sybaseCreateSQL(self)
- other = findClass(self.foreignKey)
+ other = findClass(self.foreignKey, self.soClass.sqlmeta.registry)
tName = other.sqlmeta.table
idName = other.sqlmeta.idName
reference = ('REFERENCES %(tName)s(%(idName)s) ' %
@@ -870,7 +870,7 @@
def mssqlCreateSQL(self):
sql = SOKeyCol.mssqlCreateSQL(self)
- other = findClass(self.foreignKey)
+ other = findClass(self.foreignKey, self.soClass.sqlmeta.registry)
tName = other.sqlmeta.table
idName = other.sqlmeta.idName
reference = ('REFERENCES %(tName)s(%(idName)s) ' %
@@ -884,7 +884,7 @@
return None
def maxdbCreateSQL(self):
- other = findClass(self.foreignKey)
+ other = findClass(self.foreignKey, self.soClass.sqlmeta.registry)
fidName = self.dbName
#I assume that foreign key name is identical to the id of the reference table
sql = ' '.join([fidName, self._maxdbType()])
|
|
From: <sub...@co...> - 2008-03-17 17:35:35
|
Author: phd
Date: 2008-03-17 11:35:09 -0600 (Mon, 17 Mar 2008)
New Revision: 3339
Modified:
SQLObject/branches/0.9/docs/News.txt
SQLObject/branches/0.9/sqlobject/col.py
Log:
A minor bug was fixed in col.py - the registry must be passed to findClass().
Modified: SQLObject/branches/0.9/docs/News.txt
===================================================================
--- SQLObject/branches/0.9/docs/News.txt 2008-03-17 17:25:09 UTC (rev 3338)
+++ SQLObject/branches/0.9/docs/News.txt 2008-03-17 17:35:09 UTC (rev 3339)
@@ -12,6 +12,8 @@
* A bug in inheritable delColumn() that doesn't removes properties was fixed.
+* A minor bug was fixed in col.py - the registry must be passed to findClass().
+
SQLObject 0.9.5
===============
Modified: SQLObject/branches/0.9/sqlobject/col.py
===================================================================
--- SQLObject/branches/0.9/sqlobject/col.py 2008-03-17 17:25:09 UTC (rev 3338)
+++ SQLObject/branches/0.9/sqlobject/col.py 2008-03-17 17:35:09 UTC (rev 3339)
@@ -788,7 +788,7 @@
def sqliteCreateSQL(self):
sql = SOKeyCol.sqliteCreateSQL(self)
- other = findClass(self.foreignKey)
+ other = findClass(self.foreignKey, self.soClass.sqlmeta.registry)
tName = other.sqlmeta.table
idName = other.sqlmeta.idName
if self.cascade is not None:
@@ -870,7 +870,7 @@
def sybaseCreateSQL(self):
sql = SOKeyCol.sybaseCreateSQL(self)
- other = findClass(self.foreignKey)
+ other = findClass(self.foreignKey, self.soClass.sqlmeta.registry)
tName = other.sqlmeta.table
idName = other.sqlmeta.idName
reference = ('REFERENCES %(tName)s(%(idName)s) ' %
@@ -885,7 +885,7 @@
def mssqlCreateSQL(self):
sql = SOKeyCol.mssqlCreateSQL(self)
- other = findClass(self.foreignKey)
+ other = findClass(self.foreignKey, self.soClass.sqlmeta.registry)
tName = other.sqlmeta.table
idName = other.sqlmeta.idName
reference = ('REFERENCES %(tName)s(%(idName)s) ' %
@@ -899,7 +899,7 @@
return None
def maxdbCreateSQL(self):
- other = findClass(self.foreignKey)
+ other = findClass(self.foreignKey, self.soClass.sqlmeta.registry)
fidName = self.dbName
#I assume that foreign key name is identical to the id of the reference table
sql = ' '.join([fidName, self._maxdbType()])
|
|
From: <sub...@co...> - 2008-03-17 17:25:15
|
Author: phd
Date: 2008-03-17 11:25:09 -0600 (Mon, 17 Mar 2008)
New Revision: 3338
Modified:
SQLObject/trunk/docs/News.txt
SQLObject/trunk/sqlobject/postgres/pgconnection.py
Log:
Dropped support for PostgreSQL 7.2. The minimal supported version of PostgreSQL is 7.3 now.
Modified: SQLObject/trunk/docs/News.txt
===================================================================
--- SQLObject/trunk/docs/News.txt 2008-03-14 18:18:36 UTC (rev 3337)
+++ SQLObject/trunk/docs/News.txt 2008-03-17 17:25:09 UTC (rev 3338)
@@ -18,6 +18,9 @@
* Use reversed() in manager/command.py instead of .__reversed__().
+* Dropped support for PostgreSQL 7.2. The minimal supported version of
+ PostgreSQL is 7.3 now.
+
SQLObject 0.10.0
================
Modified: SQLObject/trunk/sqlobject/postgres/pgconnection.py
===================================================================
--- SQLObject/trunk/sqlobject/postgres/pgconnection.py 2008-03-14 18:18:36 UTC (rev 3337)
+++ SQLObject/trunk/sqlobject/postgres/pgconnection.py 2008-03-17 17:25:09 UTC (rev 3338)
@@ -87,9 +87,6 @@
self.unicodeCols = unicodeCols
DBAPI.__init__(self, **kw)
- # Server version cache
- self._server_version = None # Not yet initialized
-
def connectionFromURI(cls, uri):
user, password, host, port, path, args = cls._parseURI(uri)
path = path.strip('/')
@@ -160,8 +157,6 @@
return '%s %s PRIMARY KEY' % (soClass.sqlmeta.idName, key_type)
def dropTable(self, tableName, cascade=False):
- if self.server_version[:3] <= "7.2":
- cascade=False
self.query("DROP TABLE %s %s" % (tableName,
cascade and 'CASCADE' or ''))
@@ -297,15 +292,6 @@
return True
return getattr(sqlbuilder.const, defaultstr)
- def server_version(self):
- if self._server_version is None:
- # The result is something like
- # ' PostgreSQL 7.2.1 on i686-pc-linux-gnu, compiled by GCC 2.95.4'
- server_version = self.queryOne("SELECT version()")[0]
- self._server_version = server_version.split()[1]
- return self._server_version
- server_version = property(server_version)
-
def createEmptyDatabase(self):
# We have to connect to *some* database, so we'll connect to
# template1, which is a common open database.
|
|
From: <sub...@co...> - 2008-03-12 22:22:38
|
Author: phd Date: 2008-03-12 16:22:34 -0600 (Wed, 12 Mar 2008) New Revision: 3336 Modified: SQLObject/trunk/docs/News.txt Log: It was SQLObject 0.10.0 released 11 Mar 2008, not the trunk. Modified: SQLObject/trunk/docs/News.txt =================================================================== --- SQLObject/trunk/docs/News.txt 2008-03-12 22:21:20 UTC (rev 3335) +++ SQLObject/trunk/docs/News.txt 2008-03-12 22:22:34 UTC (rev 3336) @@ -10,8 +10,6 @@ SQLObject (trunk) ================= -Released 11 Mar 2008. - Features & Interface -------------------- @@ -23,6 +21,8 @@ SQLObject 0.10.0 ================ +Released 11 Mar 2008. + Features & Interface -------------------- |
|
From: <sub...@co...> - 2008-03-12 22:21:30
|
Author: phd Date: 2008-03-12 16:21:20 -0600 (Wed, 12 Mar 2008) New Revision: 3335 Modified: SQLObject/branches/0.10/docs/News.txt Log: This is a stable branch - no docs from the trunk. Modified: SQLObject/branches/0.10/docs/News.txt =================================================================== --- SQLObject/branches/0.10/docs/News.txt 2008-03-11 13:34:01 UTC (rev 3334) +++ SQLObject/branches/0.10/docs/News.txt 2008-03-12 22:21:20 UTC (rev 3335) @@ -7,9 +7,6 @@ .. _start: -SQLObject (trunk) -================= - SQLObject 0.10.0 ================ |
|
From: <sub...@co...> - 2008-03-11 13:34:07
|
Author: phd Date: 2008-03-11 07:34:01 -0600 (Tue, 11 Mar 2008) New Revision: 3334 Modified: SQLObject/tags/0.10.0/docs/News.txt SQLObject/tags/0.10.0/setup.cfg SQLObject/tags/0.10.0/setup.py SQLObject/tags/0.10.0/sqlobject/__init__.py SQLObject/tags/0.10.0/sqlobject/main.py Log: SQLObject 0.10.0 released 11 Mar 2008. Modified: SQLObject/tags/0.10.0/docs/News.txt =================================================================== --- SQLObject/tags/0.10.0/docs/News.txt 2008-03-11 13:32:39 UTC (rev 3333) +++ SQLObject/tags/0.10.0/docs/News.txt 2008-03-11 13:34:01 UTC (rev 3334) @@ -13,6 +13,8 @@ SQLObject 0.10.0 ================ +Released 11 Mar 2008. + Features & Interface -------------------- Modified: SQLObject/tags/0.10.0/setup.cfg =================================================================== --- SQLObject/tags/0.10.0/setup.cfg 2008-03-11 13:32:39 UTC (rev 3333) +++ SQLObject/tags/0.10.0/setup.cfg 2008-03-11 13:34:01 UTC (rev 3334) @@ -5,10 +5,6 @@ [easy_install] #find_links = http://svn.pythonpaste.org/package_index.html -[egg_info] -tag_build = dev -tag_svn_revision = true - [pudge] theme = pythonpaste.org docs = docs/index.txt docs/Authors.txt docs/DeveloperGuide.txt docs/FAQ.txt Modified: SQLObject/tags/0.10.0/setup.py =================================================================== --- SQLObject/tags/0.10.0/setup.py 2008-03-11 13:32:39 UTC (rev 3333) +++ SQLObject/tags/0.10.0/setup.py 2008-03-11 13:34:01 UTC (rev 3334) @@ -21,7 +21,7 @@ """ setup(name="SQLObject", - version="0.10", + version="0.10.0", description="Object-Relational Manager, aka database wrapper", long_description="""\ SQLObject is a popular *Object Relational Manager* for providing an @@ -48,8 +48,8 @@ ], author="Ian Bicking", author_email="ia...@co...", - url="http://sqlobject.org/devel/", - download_url="http://cheeseshop.python.org/pypi/SQLObject/0.10", + url="http://sqlobject.org/", + download_url="http://cheeseshop.python.org/pypi/SQLObject/0.10.0", license="LGPL", packages=["sqlobject"] + ['sqlobject.%s' % package for package in subpackages], scripts=["scripts/sqlobject-admin"], Modified: SQLObject/tags/0.10.0/sqlobject/__init__.py =================================================================== --- SQLObject/tags/0.10.0/sqlobject/__init__.py 2008-03-11 13:32:39 UTC (rev 3333) +++ SQLObject/tags/0.10.0/sqlobject/__init__.py 2008-03-11 13:34:01 UTC (rev 3334) @@ -1,5 +1,5 @@ """ -SQLObject 0.10 +SQLObject 0.10.0 """ from main import * Modified: SQLObject/tags/0.10.0/sqlobject/main.py =================================================================== --- SQLObject/tags/0.10.0/sqlobject/main.py 2008-03-11 13:32:39 UTC (rev 3333) +++ SQLObject/tags/0.10.0/sqlobject/main.py 2008-03-11 13:34:01 UTC (rev 3334) @@ -1,6 +1,6 @@ """ -SQLObject 0.10 --------------- +SQLObject 0.10.0 +---------------- :author: Ian Bicking <ia...@co...> |
|
From: <sub...@co...> - 2008-03-11 13:32:44
|
Author: phd
Date: 2008-03-11 07:32:39 -0600 (Tue, 11 Mar 2008)
New Revision: 3333
Modified:
SQLObject/branches/0.10/setup.py
Log:
It is now becoming the stable release.
Modified: SQLObject/branches/0.10/setup.py
===================================================================
--- SQLObject/branches/0.10/setup.py 2008-03-11 13:30:14 UTC (rev 3332)
+++ SQLObject/branches/0.10/setup.py 2008-03-11 13:32:39 UTC (rev 3333)
@@ -48,7 +48,7 @@
],
author="Ian Bicking",
author_email="ia...@co...",
- url="http://sqlobject.org/devel/",
+ url="http://sqlobject.org/",
download_url="http://cheeseshop.python.org/pypi/SQLObject/0.10",
license="LGPL",
packages=["sqlobject"] + ['sqlobject.%s' % package for package in subpackages],
|
|
From: <sub...@co...> - 2008-03-11 13:30:23
|
Author: phd Date: 2008-03-11 07:30:14 -0600 (Tue, 11 Mar 2008) New Revision: 3332 Modified: SQLObject/trunk/docs/News.txt Log: SQLObject 0.10.0 released 11 Mar 2008. Modified: SQLObject/trunk/docs/News.txt =================================================================== --- SQLObject/trunk/docs/News.txt 2008-03-11 13:28:26 UTC (rev 3331) +++ SQLObject/trunk/docs/News.txt 2008-03-11 13:30:14 UTC (rev 3332) @@ -10,6 +10,8 @@ SQLObject (trunk) ================= +Released 11 Mar 2008. + Features & Interface -------------------- |
|
From: <sub...@co...> - 2008-03-11 13:28:32
|
Author: phd Date: 2008-03-11 07:28:26 -0600 (Tue, 11 Mar 2008) New Revision: 3331 Modified: SQLObject/branches/0.10/docs/News.txt Log: SQLObject 0.10.0 released 11 Mar 2008. Modified: SQLObject/branches/0.10/docs/News.txt =================================================================== --- SQLObject/branches/0.10/docs/News.txt 2008-03-11 13:27:19 UTC (rev 3330) +++ SQLObject/branches/0.10/docs/News.txt 2008-03-11 13:28:26 UTC (rev 3331) @@ -13,6 +13,8 @@ SQLObject 0.10.0 ================ +Released 11 Mar 2008. + Features & Interface -------------------- |
|
From: <sub...@co...> - 2008-03-11 13:27:30
|
Author: phd Date: 2008-03-11 07:27:19 -0600 (Tue, 11 Mar 2008) New Revision: 3330 Added: SQLObject/tags/0.10.0/ Log: Tagging 0.10.0 Copied: SQLObject/tags/0.10.0 (from rev 3329, SQLObject/branches/0.10) |
|
From: <sub...@co...> - 2008-03-11 12:48:56
|
Author: phd
Date: 2008-03-11 06:48:52 -0600 (Tue, 11 Mar 2008)
New Revision: 3329
Modified:
SQLObject/trunk/sqlobject/main.py
Log:
Do not emit a deprecation warning for Python 2.4.
Modified: SQLObject/trunk/sqlobject/main.py
===================================================================
--- SQLObject/trunk/sqlobject/main.py 2008-03-11 12:46:09 UTC (rev 3328)
+++ SQLObject/trunk/sqlobject/main.py 2008-03-11 12:48:52 UTC (rev 3329)
@@ -659,8 +659,8 @@
if warnings_level is not None and warnings_level <= level:
warnings.warn(message, DeprecationWarning, stacklevel=stacklevel)
-if sys.version_info[:3] < (2, 5, 0):
- deprecated("Support for Python 2.4 has been declared obsolete and will be removed in the next release of SQLObject")
+#if sys.version_info[:3] < (2, 5, 0):
+# deprecated("Support for Python 2.4 has been declared obsolete and will be removed in the next release of SQLObject")
def setDeprecationLevel(warning=1, exception=None):
"""
|
|
From: <sub...@co...> - 2008-03-11 12:46:14
|
Author: phd
Date: 2008-03-11 06:46:09 -0600 (Tue, 11 Mar 2008)
New Revision: 3328
Modified:
SQLObject/trunk/docs/News.txt
SQLObject/trunk/sqlobject/inheritance/__init__.py
Log:
A bug in inheritable delColumn() that doesn't removes properties was fixed.
Modified: SQLObject/trunk/docs/News.txt
===================================================================
--- SQLObject/trunk/docs/News.txt 2008-03-11 12:45:44 UTC (rev 3327)
+++ SQLObject/trunk/docs/News.txt 2008-03-11 12:46:09 UTC (rev 3328)
@@ -86,6 +86,11 @@
* Under MySQL, PickleCol no longer used TEXT column types; the smallest
column is now BLOB - it is not possible to create TINYBLOB column.
+SQLObject 0.9.6
+===============
+
+* A bug in inheritable delColumn() that doesn't removes properties was fixed.
+
SQLObject 0.9.5
===============
Modified: SQLObject/trunk/sqlobject/inheritance/__init__.py
===================================================================
--- SQLObject/trunk/sqlobject/inheritance/__init__.py 2008-03-11 12:45:44 UTC (rev 3327)
+++ SQLObject/trunk/sqlobject/inheritance/__init__.py 2008-03-11 12:46:09 UTC (rev 3328)
@@ -2,7 +2,7 @@
from sqlobject import classregistry
from sqlobject.col import StringCol, ForeignKey
from sqlobject.main import sqlmeta, SQLObject, SelectResults, \
- makeProperties, getterName, setterName
+ makeProperties, unmakeProperties, getterName, setterName
import iteration
def tablesUsedSet(obj, db):
@@ -126,19 +126,27 @@
addColumn = classmethod(addColumn)
- def delColumn(sqlmeta, column, changeSchema=False, connection=None):
- soClass = sqlmeta.soClass
+ def delColumn(sqlmeta, column, changeSchema=False, connection=None, childUpdate=False):
+ if childUpdate:
+ soClass = sqlmeta.soClass
+ unmakeProperties(soClass)
+ makeProperties(soClass)
+
+ if isinstance(column, str):
+ name = column
+ else:
+ name = column.name
+ delattr(soClass, name)
+ delattr(soClass.q, name)
+ return
+
super(InheritableSQLMeta, sqlmeta).delColumn(column, changeSchema, connection)
- if isinstance(column, str):
- name = column
- else:
- name = column.name
-
#DSM: Update each child class if needed
#DSM: and delete properties for this column
for c in sqlmeta.childClasses.values():
- delattr(c.q, name)
+ c.sqlmeta.delColumn(column, changeSchema=changeSchema,
+ connection=connection, childUpdate=True)
delColumn = classmethod(delColumn)
@@ -173,15 +181,19 @@
addJoin = classmethod(addJoin)
- def delJoin(sqlmeta, joinDef):
- soClass = sqlmeta.soClass
+ def delJoin(sqlmeta, joinDef, childUpdate=False):
+ if childUpdate:
+ soClass = sqlmeta.soClass
+ unmakeProperties(soClass)
+ makeProperties(soClass)
+ return
+
super(InheritableSQLMeta, sqlmeta).delJoin(joinDef)
#DSM: Update each child class if needed
#DSM: and delete properties for this join
for c in sqlmeta.childClasses.values():
- # FIXME: what is ``meth``?
- delattr(c, meth)
+ c.sqlmeta.delJoin(joinDef, childUpdate=True)
delJoin = classmethod(delJoin)
|
|
From: <sub...@co...> - 2008-03-11 12:45:52
|
Author: phd
Date: 2008-03-11 06:45:44 -0600 (Tue, 11 Mar 2008)
New Revision: 3327
Modified:
SQLObject/branches/0.10/docs/News.txt
SQLObject/branches/0.10/sqlobject/inheritance/__init__.py
Log:
A bug in inheritable delColumn() that doesn't removes properties was fixed.
Modified: SQLObject/branches/0.10/docs/News.txt
===================================================================
--- SQLObject/branches/0.10/docs/News.txt 2008-03-11 12:45:10 UTC (rev 3326)
+++ SQLObject/branches/0.10/docs/News.txt 2008-03-11 12:45:44 UTC (rev 3327)
@@ -78,6 +78,11 @@
* Under MySQL, PickleCol no longer uses TEXT column types; the smallest
column is now BLOB - it is not possible to create TINYBLOB column.
+SQLObject 0.9.6
+===============
+
+* A bug in inheritable delColumn() that doesn't removes properties was fixed.
+
SQLObject 0.9.5
===============
Modified: SQLObject/branches/0.10/sqlobject/inheritance/__init__.py
===================================================================
--- SQLObject/branches/0.10/sqlobject/inheritance/__init__.py 2008-03-11 12:45:10 UTC (rev 3326)
+++ SQLObject/branches/0.10/sqlobject/inheritance/__init__.py 2008-03-11 12:45:44 UTC (rev 3327)
@@ -2,7 +2,7 @@
from sqlobject import classregistry
from sqlobject.col import StringCol, ForeignKey
from sqlobject.main import sqlmeta, SQLObject, SelectResults, \
- makeProperties, getterName, setterName
+ makeProperties, unmakeProperties, getterName, setterName
import iteration
try:
@@ -132,19 +132,27 @@
addColumn = classmethod(addColumn)
- def delColumn(sqlmeta, column, changeSchema=False, connection=None):
- soClass = sqlmeta.soClass
+ def delColumn(sqlmeta, column, changeSchema=False, connection=None, childUpdate=False):
+ if childUpdate:
+ soClass = sqlmeta.soClass
+ unmakeProperties(soClass)
+ makeProperties(soClass)
+
+ if isinstance(column, str):
+ name = column
+ else:
+ name = column.name
+ delattr(soClass, name)
+ delattr(soClass.q, name)
+ return
+
super(InheritableSQLMeta, sqlmeta).delColumn(column, changeSchema, connection)
- if isinstance(column, str):
- name = column
- else:
- name = column.name
-
#DSM: Update each child class if needed
#DSM: and delete properties for this column
for c in sqlmeta.childClasses.values():
- delattr(c.q, name)
+ c.sqlmeta.delColumn(column, changeSchema=changeSchema,
+ connection=connection, childUpdate=True)
delColumn = classmethod(delColumn)
@@ -179,15 +187,19 @@
addJoin = classmethod(addJoin)
- def delJoin(sqlmeta, joinDef):
- soClass = sqlmeta.soClass
+ def delJoin(sqlmeta, joinDef, childUpdate=False):
+ if childUpdate:
+ soClass = sqlmeta.soClass
+ unmakeProperties(soClass)
+ makeProperties(soClass)
+ return
+
super(InheritableSQLMeta, sqlmeta).delJoin(joinDef)
#DSM: Update each child class if needed
#DSM: and delete properties for this join
for c in sqlmeta.childClasses.values():
- # FIXME: what is ``meth``?
- delattr(c, meth)
+ c.sqlmeta.delJoin(joinDef, childUpdate=True)
delJoin = classmethod(delJoin)
|
|
From: <sub...@co...> - 2008-03-11 12:45:20
|
Author: phd
Date: 2008-03-11 06:45:10 -0600 (Tue, 11 Mar 2008)
New Revision: 3326
Modified:
SQLObject/branches/0.9/docs/News.txt
SQLObject/branches/0.9/sqlobject/inheritance/__init__.py
Log:
A bug in inheritable delColumn() that doesn't removes properties was fixed.
Modified: SQLObject/branches/0.9/docs/News.txt
===================================================================
--- SQLObject/branches/0.9/docs/News.txt 2008-03-10 22:52:21 UTC (rev 3325)
+++ SQLObject/branches/0.9/docs/News.txt 2008-03-11 12:45:10 UTC (rev 3326)
@@ -7,6 +7,11 @@
.. _start:
+SQLObject 0.9.6
+===============
+
+* A bug in inheritable delColumn() that doesn't removes properties was fixed.
+
SQLObject 0.9.5
===============
Modified: SQLObject/branches/0.9/sqlobject/inheritance/__init__.py
===================================================================
--- SQLObject/branches/0.9/sqlobject/inheritance/__init__.py 2008-03-10 22:52:21 UTC (rev 3325)
+++ SQLObject/branches/0.9/sqlobject/inheritance/__init__.py 2008-03-11 12:45:10 UTC (rev 3326)
@@ -2,7 +2,7 @@
from sqlobject import classregistry
from sqlobject.col import StringCol, ForeignKey
from sqlobject.main import sqlmeta, SQLObject, SelectResults, True, False, \
- makeProperties, getterName, setterName
+ makeProperties, unmakeProperties, getterName, setterName
import iteration
@@ -131,19 +131,27 @@
addColumn = classmethod(addColumn)
- def delColumn(sqlmeta, column, changeSchema=False, connection=None):
- soClass = sqlmeta.soClass
+ def delColumn(sqlmeta, column, changeSchema=False, connection=None, childUpdate=False):
+ if childUpdate:
+ soClass = sqlmeta.soClass
+ unmakeProperties(soClass)
+ makeProperties(soClass)
+
+ if isinstance(column, str):
+ name = column
+ else:
+ name = column.name
+ delattr(soClass, name)
+ delattr(soClass.q, name)
+ return
+
super(InheritableSQLMeta, sqlmeta).delColumn(column, changeSchema, connection)
- if isinstance(column, str):
- name = column
- else:
- name = column.name
-
#DSM: Update each child class if needed
#DSM: and delete properties for this column
for c in sqlmeta.childClasses.values():
- delattr(c.q, name)
+ c.sqlmeta.delColumn(column, changeSchema=changeSchema,
+ connection=connection, childUpdate=True)
delColumn = classmethod(delColumn)
@@ -178,15 +186,19 @@
addJoin = classmethod(addJoin)
- def delJoin(sqlmeta, joinDef):
- soClass = sqlmeta.soClass
+ def delJoin(sqlmeta, joinDef, childUpdate=False):
+ if childUpdate:
+ soClass = sqlmeta.soClass
+ unmakeProperties(soClass)
+ makeProperties(soClass)
+ return
+
super(InheritableSQLMeta, sqlmeta).delJoin(joinDef)
#DSM: Update each child class if needed
#DSM: and delete properties for this join
for c in sqlmeta.childClasses.values():
- # FIXME: what is ``meth``?
- delattr(c, meth)
+ c.sqlmeta.delJoin(joinDef, childUpdate=True)
delJoin = classmethod(delJoin)
|
|
From: <sub...@co...> - 2008-03-10 22:52:27
|
Author: phd Date: 2008-03-10 16:52:21 -0600 (Mon, 10 Mar 2008) New Revision: 3325 Modified: SQLObject/trunk/docs/News.txt Log: Minor English grammar correction. Modified: SQLObject/trunk/docs/News.txt =================================================================== --- SQLObject/trunk/docs/News.txt 2008-03-10 22:52:09 UTC (rev 3324) +++ SQLObject/trunk/docs/News.txt 2008-03-10 22:52:21 UTC (rev 3325) @@ -93,7 +93,7 @@ * Fixed a minor bug in SQLiteConnection.columnsFromSchema() - set dbName. -* A bug in delColumn() that removes all properties is fixed by recreating +* A bug in delColumn() that removes all properties was fixed by recreating properties. SQLObject 0.9.4 |
|
From: <sub...@co...> - 2008-03-10 22:52:13
|
Author: phd Date: 2008-03-10 16:52:09 -0600 (Mon, 10 Mar 2008) New Revision: 3324 Modified: SQLObject/branches/0.10/docs/News.txt Log: Minor English grammar correction. Modified: SQLObject/branches/0.10/docs/News.txt =================================================================== --- SQLObject/branches/0.10/docs/News.txt 2008-03-10 22:51:41 UTC (rev 3323) +++ SQLObject/branches/0.10/docs/News.txt 2008-03-10 22:52:09 UTC (rev 3324) @@ -85,7 +85,7 @@ * Fixed a minor bug in SQLiteConnection.columnsFromSchema() - set dbName. -* A bug in delColumn() that removes all properties is fixed by recreating +* A bug in delColumn() that removes all properties was fixed by recreating properties. SQLObject 0.9.4 |
|
From: <sub...@co...> - 2008-03-10 22:51:47
|
Author: phd Date: 2008-03-10 16:51:41 -0600 (Mon, 10 Mar 2008) New Revision: 3323 Modified: SQLObject/branches/0.9/docs/News.txt Log: Minor English grammar correction. Modified: SQLObject/branches/0.9/docs/News.txt =================================================================== --- SQLObject/branches/0.9/docs/News.txt 2008-03-10 16:12:42 UTC (rev 3322) +++ SQLObject/branches/0.9/docs/News.txt 2008-03-10 22:51:41 UTC (rev 3323) @@ -14,7 +14,7 @@ * Fixed a minor bug in SQLiteConnection.columnsFromSchema() - set dbName. -* A bug in delColumn() that removes all properties is fixed by recreating +* A bug in delColumn() that removes all properties was fixed by recreating properties. SQLObject 0.9.4 |