sqlobject-cvs Mailing List for SQLObject (Page 129)
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
(9) |
Apr
(74) |
May
(29) |
Jun
(16) |
Jul
(28) |
Aug
(10) |
Sep
(57) |
Oct
(9) |
Nov
(29) |
Dec
(12) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(7) |
Feb
(14) |
Mar
(6) |
Apr
(3) |
May
(12) |
Jun
(34) |
Jul
(9) |
Aug
(29) |
Sep
(22) |
Oct
(2) |
Nov
(15) |
Dec
(52) |
| 2005 |
Jan
(47) |
Feb
(78) |
Mar
(14) |
Apr
(35) |
May
(33) |
Jun
(16) |
Jul
(26) |
Aug
(63) |
Sep
(40) |
Oct
(96) |
Nov
(96) |
Dec
(123) |
| 2006 |
Jan
(159) |
Feb
(144) |
Mar
(64) |
Apr
(31) |
May
(88) |
Jun
(48) |
Jul
(16) |
Aug
(64) |
Sep
(87) |
Oct
(92) |
Nov
(56) |
Dec
(76) |
| 2007 |
Jan
(94) |
Feb
(103) |
Mar
(126) |
Apr
(123) |
May
(85) |
Jun
(11) |
Jul
(130) |
Aug
(47) |
Sep
(65) |
Oct
(70) |
Nov
(12) |
Dec
(11) |
| 2008 |
Jan
(30) |
Feb
(55) |
Mar
(88) |
Apr
(20) |
May
(50) |
Jun
|
Jul
(38) |
Aug
(1) |
Sep
(9) |
Oct
(5) |
Nov
(6) |
Dec
(39) |
| 2009 |
Jan
(8) |
Feb
(16) |
Mar
(3) |
Apr
(33) |
May
(44) |
Jun
(1) |
Jul
(10) |
Aug
(33) |
Sep
(74) |
Oct
(22) |
Nov
|
Dec
(15) |
| 2010 |
Jan
(28) |
Feb
(22) |
Mar
(46) |
Apr
(29) |
May
(1) |
Jun
(1) |
Jul
(27) |
Aug
(8) |
Sep
(5) |
Oct
(33) |
Nov
(24) |
Dec
(41) |
| 2011 |
Jan
(4) |
Feb
(12) |
Mar
(35) |
Apr
(29) |
May
(19) |
Jun
(16) |
Jul
(32) |
Aug
(25) |
Sep
(5) |
Oct
(11) |
Nov
(21) |
Dec
(12) |
| 2012 |
Jan
(3) |
Feb
(4) |
Mar
(20) |
Apr
(4) |
May
(25) |
Jun
(13) |
Jul
|
Aug
|
Sep
(2) |
Oct
(25) |
Nov
(9) |
Dec
(1) |
| 2013 |
Jan
(6) |
Feb
(8) |
Mar
|
Apr
(10) |
May
(31) |
Jun
(7) |
Jul
(18) |
Aug
(33) |
Sep
(4) |
Oct
(16) |
Nov
|
Dec
(27) |
| 2014 |
Jan
(2) |
Feb
|
Mar
|
Apr
(11) |
May
(39) |
Jun
(8) |
Jul
(11) |
Aug
(4) |
Sep
|
Oct
(27) |
Nov
|
Dec
(71) |
| 2015 |
Jan
(17) |
Feb
(47) |
Mar
(33) |
Apr
|
May
|
Jun
(9) |
Jul
(7) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(8) |
| 2016 |
Jan
(4) |
Feb
(4) |
Mar
|
Apr
|
May
(12) |
Jun
(7) |
Jul
(9) |
Aug
(31) |
Sep
(8) |
Oct
(3) |
Nov
(15) |
Dec
(1) |
| 2017 |
Jan
(13) |
Feb
(7) |
Mar
(14) |
Apr
(8) |
May
(10) |
Jun
(4) |
Jul
(2) |
Aug
(1) |
Sep
|
Oct
(8) |
Nov
(4) |
Dec
(5) |
| 2018 |
Jan
(2) |
Feb
(8) |
Mar
|
Apr
(4) |
May
|
Jun
(6) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2019 |
Jan
(1) |
Feb
(16) |
Mar
(1) |
Apr
(3) |
May
(5) |
Jun
(1) |
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
(1) |
Dec
(3) |
| 2020 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(1) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
(2) |
Nov
|
Dec
(2) |
| 2021 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(1) |
Dec
|
| 2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(6) |
Oct
(1) |
Nov
(1) |
Dec
(4) |
| 2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(3) |
Sep
(2) |
Oct
(2) |
Nov
(4) |
Dec
|
| 2024 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(9) |
| 2025 |
Jan
|
Feb
(4) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
(2) |
Dec
(2) |
|
From: SourceForge.net <no...@so...> - 2006-05-18 17:48:07
|
Patches item #1483018, was opened at 2006-05-06 08:19 Message generated for change (Comment added) made by russf You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1483018&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 Submitted By: Russ Ferriday (russf) Assigned to: Nobody/Anonymous (nobody) Summary: Play nicely with mxDateTime Initial Comment: Related to version: =========== URL: http://svn.colorstudy.com/SQLObject/trunk Repository UUID: 95a46c32-92d2-0310-94a5-8d71aeb3d4b3 Revision: 1748 Fixes problem: ========= File "/usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py", line 63, in ? TimeType = type(DateTime.Time()) AttributeError: 'module' object has no attribute 'Time' Description: ======== I'm using SQLObject with Zope and Python 2.4. Path to Time is longer than the original code was expecting. And it needs a param - DateTime. Patch: ==== --- col.py.orig 2006-05-05 19:30:39.000000000 +0100 +++ col.py 2006-05-06 16:02:33.000000000 +0100 @@ -60,7 +60,7 @@ if mxdatetime_available: DateTimeType = type(DateTime.now()) - TimeType = type(DateTime.Time()) + TimeType = type(DateTime.DateTime.Time(DateTime.DateTime())) if datetime_available: default_datetime_implementation = DATETIME_IMPLEMENTATION ---------------------------------------------------------------------- >Comment By: Russ Ferriday (russf) Date: 2006-05-18 10:47 Message: Logged In: YES user_id=478441 OK. I'll follow up on that, and get back in a day or two. ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2006-05-18 10:39 Message: Logged In: YES user_id=4799 Your patch certainly breaks old mx DateTime, so you should extend the patch to distinguish old mxDateTime (without mx top-level package) and non-mx DateTime from Zope. IWBN if you can also run test suite or at least test_datetime.py. The test suite requires py.test framework. ---------------------------------------------------------------------- Comment By: Russ Ferriday (russf) Date: 2006-05-18 10:21 Message: Logged In: YES user_id=478441 Thanks for your patience, Oleg, Ian, > Does the confusion here have something to do with Zope's > DateTime module being confused for mx.DateTime? Digging deeper, yes it does. It's Zope's DateTime.py that ends up being imported. (Pdb) print sys.modules['DateTime'] <module 'DateTime' from '/usr/local/zope/zope/lib/python/DateTime/ __init__.pyc'> When I add that kludge as shown in the original patch, Zope and SQLObject work fine together, as far as it goes. And I'm using DateTimeCol in several tables without issues. I'm open to suggestions as how to best handle this. Any more thoughts? ---------------------------------------------------------------------- Comment By: Ian Bicking (ianbicking) Date: 2006-05-18 10:07 Message: Logged In: YES user_id=210337 Does the confusion here have something to do with Zope's DateTime module being confused for mx.DateTime? I don't think we support Zope's DateTime at all; adding support for that would be separate, though I think mx.DateTime is usually available where Zope's DateTime is also available. Anyway, on some level this is definitely a problem with imports, not with the code. "DateTime" is meant to be the mx DateTime module, which contains "now", etc.; if it doesn't contain that, then the import is wrong, not the code. ---------------------------------------------------------------------- Comment By: Russ Ferriday (russf) Date: 2006-05-18 10:01 Message: Logged In: YES user_id=478441 Yes, it helps as far as line 63 when I get this: File "/usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py", line 63, in ? DateTimeType = type(DateTime.now()) AttributeError: class DateTime has no attribute 'now' ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2006-05-18 09:45 Message: Logged In: YES user_id=4799 Can you instead of your fix replace the line 50 import DateTime with from DateTime import DateTime and test if this helps? ---------------------------------------------------------------------- Comment By: Russ Ferriday (russf) Date: 2006-05-18 09:14 Message: Logged In: YES user_id=478441 Thanks for looking at this. OK, so at my command line, explicitly using the same python: /usr/local/zope/python/bin/python Python 2.4.2 (#1, Mar 28 2006, 15:06:21) [GCC 4.0.0 20041026 (Apple Computer, Inc. build 4061)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import DateTime Traceback (most recent call last): File "<stdin>", line 1, in ? ImportError: No module named DateTime We see that DateTime is not importable. But this is not relevant to the case when I'm running in zope. This is where pdb comes into its own. I think this adventure is self explanatory: /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(39)?() -> try: (Pdb) l 34 from util.backports import count 35 36 NoDefault = sqlbuilder.NoDefault 37 True, False = 1==1, 0==1 38 import pdb; pdb.set_trace() 39 -> try: 40 import datetime 41 except ImportError: # Python 2.2 42 datetime_available = False 43 else: 44 datetime_available = True (Pdb) import datetime (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(40)?() -> import datetime (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(44)?() -> datetime_available = True (Pdb) l 39 try: 40 import datetime 41 except ImportError: # Python 2.2 42 datetime_available = False 43 else: 44 -> datetime_available = True 45 46 try: 47 from mx import DateTime 48 except ImportError: 49 try: (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(46)?() -> try: (Pdb) l 41 except ImportError: # Python 2.2 42 datetime_available = False 43 else: 44 datetime_available = True 45 46 -> try: 47 from mx import DateTime 48 except ImportError: 49 try: 50 import DateTime # old version of mxDateTime 51 except ImportError: (Pdb) from mx import DateTime *** ImportError: No module named mx (Pdb) import DateTime (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(47)?() -> from mx import DateTime (Pdb) n ImportError: 'No module named mx' > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(47)?() -> from mx import DateTime (Pdb) s > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(48)?() -> except ImportError: (Pdb) s > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(49)?() -> try: (Pdb) l 44 datetime_available = True 45 46 try: 47 from mx import DateTime 48 except ImportError: 49 -> try: 50 import DateTime # old version of mxDateTime 51 except ImportError: 52 mxdatetime_available = False 53 else: 54 mxdatetime_available = True (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(50)?() -> import DateTime # old version of mxDateTime (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(54)?() -> mxdatetime_available = True (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(58)?() -> DATETIME_IMPLEMENTATION = "datetime" (Pdb) l 53 else: 54 mxdatetime_available = True 55 else: 56 mxdatetime_available = True 57 58 -> DATETIME_IMPLEMENTATION = "datetime" 59 MXDATETIME_IMPLEMENTATION = "mxDateTime" 60 61 if mxdatetime_available: 62 DateTimeType = type(DateTime.now()) 63 TimeType = type(DateTime.DateTime.Time(DateTime.DateTime())) (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(59)?() -> MXDATETIME_IMPLEMENTATION = "mxDateTime" (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(61)?() -> if mxdatetime_available: (Pdb) l 56 mxdatetime_available = True 57 58 DATETIME_IMPLEMENTATION = "datetime" 59 MXDATETIME_IMPLEMENTATION = "mxDateTime" 60 61 -> if mxdatetime_available: 62 DateTimeType = type(DateTime.now()) 63 TimeType = type(DateTime.DateTime.Time(DateTime.DateTime())) 64 65 if datetime_available: 66 default_datetime_implementation = DATETIME_IMPLEMENTATION (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(62)?() -> DateTimeType = type(DateTime.now()) (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(63)?() -> TimeType = type(DateTime.DateTime.Time(DateTime.DateTime())) (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(65)?() -> if datetime_available: ... (Pdb) print sys.modules['DateTime'] <module 'DateTime' from '/usr/local/zope/zope/lib/python/DateTime/ __init__.pyc'> (Pdb) As you can see, in this context the changes give a valid Time Type, and SQLObject runs nicely. Without the changes, I get the message in the original post. I think my title was very misleading. What I'm actually doing is accomodating the "old" DateTime module, as mentioned on line 50. Is there some middle ground to make it possible to run SQLObject in Zope without patches? ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2006-05-18 08:03 Message: Logged In: YES user_id=4799 The patch is invalid. Try this from the command line: > python Python 2.4.3 (#2, Apr 4 2006, 23:50:10) [GCC 3.3.5 (Debian 1:3.3.5-13)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx import DateTime >>> print type(DateTime.Time()) <type 'DateTimeDelta'> >>> print type(DateTime.DateTime.Time(DateTime.DateTime())) Traceback (most recent call last): File "<stdin>", line 1, in ? AttributeError: 'builtin_function_or_method' object has no attribute 'Time' ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1483018&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2006-05-18 17:40:03
|
Patches item #1483018, was opened at 2006-05-06 19:19 Message generated for change (Comment added) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1483018&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 Submitted By: Russ Ferriday (russf) Assigned to: Nobody/Anonymous (nobody) Summary: Play nicely with mxDateTime Initial Comment: Related to version: =========== URL: http://svn.colorstudy.com/SQLObject/trunk Repository UUID: 95a46c32-92d2-0310-94a5-8d71aeb3d4b3 Revision: 1748 Fixes problem: ========= File "/usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py", line 63, in ? TimeType = type(DateTime.Time()) AttributeError: 'module' object has no attribute 'Time' Description: ======== I'm using SQLObject with Zope and Python 2.4. Path to Time is longer than the original code was expecting. And it needs a param - DateTime. Patch: ==== --- col.py.orig 2006-05-05 19:30:39.000000000 +0100 +++ col.py 2006-05-06 16:02:33.000000000 +0100 @@ -60,7 +60,7 @@ if mxdatetime_available: DateTimeType = type(DateTime.now()) - TimeType = type(DateTime.Time()) + TimeType = type(DateTime.DateTime.Time(DateTime.DateTime())) if datetime_available: default_datetime_implementation = DATETIME_IMPLEMENTATION ---------------------------------------------------------------------- >Comment By: Oleg Broytmann (phd) Date: 2006-05-18 21:39 Message: Logged In: YES user_id=4799 Your patch certainly breaks old mx DateTime, so you should extend the patch to distinguish old mxDateTime (without mx top-level package) and non-mx DateTime from Zope. IWBN if you can also run test suite or at least test_datetime.py. The test suite requires py.test framework. ---------------------------------------------------------------------- Comment By: Russ Ferriday (russf) Date: 2006-05-18 21:21 Message: Logged In: YES user_id=478441 Thanks for your patience, Oleg, Ian, > Does the confusion here have something to do with Zope's > DateTime module being confused for mx.DateTime? Digging deeper, yes it does. It's Zope's DateTime.py that ends up being imported. (Pdb) print sys.modules['DateTime'] <module 'DateTime' from '/usr/local/zope/zope/lib/python/DateTime/ __init__.pyc'> When I add that kludge as shown in the original patch, Zope and SQLObject work fine together, as far as it goes. And I'm using DateTimeCol in several tables without issues. I'm open to suggestions as how to best handle this. Any more thoughts? ---------------------------------------------------------------------- Comment By: Ian Bicking (ianbicking) Date: 2006-05-18 21:07 Message: Logged In: YES user_id=210337 Does the confusion here have something to do with Zope's DateTime module being confused for mx.DateTime? I don't think we support Zope's DateTime at all; adding support for that would be separate, though I think mx.DateTime is usually available where Zope's DateTime is also available. Anyway, on some level this is definitely a problem with imports, not with the code. "DateTime" is meant to be the mx DateTime module, which contains "now", etc.; if it doesn't contain that, then the import is wrong, not the code. ---------------------------------------------------------------------- Comment By: Russ Ferriday (russf) Date: 2006-05-18 21:01 Message: Logged In: YES user_id=478441 Yes, it helps as far as line 63 when I get this: File "/usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py", line 63, in ? DateTimeType = type(DateTime.now()) AttributeError: class DateTime has no attribute 'now' ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2006-05-18 20:45 Message: Logged In: YES user_id=4799 Can you instead of your fix replace the line 50 import DateTime with from DateTime import DateTime and test if this helps? ---------------------------------------------------------------------- Comment By: Russ Ferriday (russf) Date: 2006-05-18 20:14 Message: Logged In: YES user_id=478441 Thanks for looking at this. OK, so at my command line, explicitly using the same python: /usr/local/zope/python/bin/python Python 2.4.2 (#1, Mar 28 2006, 15:06:21) [GCC 4.0.0 20041026 (Apple Computer, Inc. build 4061)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import DateTime Traceback (most recent call last): File "<stdin>", line 1, in ? ImportError: No module named DateTime We see that DateTime is not importable. But this is not relevant to the case when I'm running in zope. This is where pdb comes into its own. I think this adventure is self explanatory: /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(39)?() -> try: (Pdb) l 34 from util.backports import count 35 36 NoDefault = sqlbuilder.NoDefault 37 True, False = 1==1, 0==1 38 import pdb; pdb.set_trace() 39 -> try: 40 import datetime 41 except ImportError: # Python 2.2 42 datetime_available = False 43 else: 44 datetime_available = True (Pdb) import datetime (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(40)?() -> import datetime (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(44)?() -> datetime_available = True (Pdb) l 39 try: 40 import datetime 41 except ImportError: # Python 2.2 42 datetime_available = False 43 else: 44 -> datetime_available = True 45 46 try: 47 from mx import DateTime 48 except ImportError: 49 try: (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(46)?() -> try: (Pdb) l 41 except ImportError: # Python 2.2 42 datetime_available = False 43 else: 44 datetime_available = True 45 46 -> try: 47 from mx import DateTime 48 except ImportError: 49 try: 50 import DateTime # old version of mxDateTime 51 except ImportError: (Pdb) from mx import DateTime *** ImportError: No module named mx (Pdb) import DateTime (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(47)?() -> from mx import DateTime (Pdb) n ImportError: 'No module named mx' > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(47)?() -> from mx import DateTime (Pdb) s > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(48)?() -> except ImportError: (Pdb) s > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(49)?() -> try: (Pdb) l 44 datetime_available = True 45 46 try: 47 from mx import DateTime 48 except ImportError: 49 -> try: 50 import DateTime # old version of mxDateTime 51 except ImportError: 52 mxdatetime_available = False 53 else: 54 mxdatetime_available = True (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(50)?() -> import DateTime # old version of mxDateTime (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(54)?() -> mxdatetime_available = True (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(58)?() -> DATETIME_IMPLEMENTATION = "datetime" (Pdb) l 53 else: 54 mxdatetime_available = True 55 else: 56 mxdatetime_available = True 57 58 -> DATETIME_IMPLEMENTATION = "datetime" 59 MXDATETIME_IMPLEMENTATION = "mxDateTime" 60 61 if mxdatetime_available: 62 DateTimeType = type(DateTime.now()) 63 TimeType = type(DateTime.DateTime.Time(DateTime.DateTime())) (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(59)?() -> MXDATETIME_IMPLEMENTATION = "mxDateTime" (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(61)?() -> if mxdatetime_available: (Pdb) l 56 mxdatetime_available = True 57 58 DATETIME_IMPLEMENTATION = "datetime" 59 MXDATETIME_IMPLEMENTATION = "mxDateTime" 60 61 -> if mxdatetime_available: 62 DateTimeType = type(DateTime.now()) 63 TimeType = type(DateTime.DateTime.Time(DateTime.DateTime())) 64 65 if datetime_available: 66 default_datetime_implementation = DATETIME_IMPLEMENTATION (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(62)?() -> DateTimeType = type(DateTime.now()) (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(63)?() -> TimeType = type(DateTime.DateTime.Time(DateTime.DateTime())) (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(65)?() -> if datetime_available: ... (Pdb) print sys.modules['DateTime'] <module 'DateTime' from '/usr/local/zope/zope/lib/python/DateTime/ __init__.pyc'> (Pdb) As you can see, in this context the changes give a valid Time Type, and SQLObject runs nicely. Without the changes, I get the message in the original post. I think my title was very misleading. What I'm actually doing is accomodating the "old" DateTime module, as mentioned on line 50. Is there some middle ground to make it possible to run SQLObject in Zope without patches? ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2006-05-18 19:03 Message: Logged In: YES user_id=4799 The patch is invalid. Try this from the command line: > python Python 2.4.3 (#2, Apr 4 2006, 23:50:10) [GCC 3.3.5 (Debian 1:3.3.5-13)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx import DateTime >>> print type(DateTime.Time()) <type 'DateTimeDelta'> >>> print type(DateTime.DateTime.Time(DateTime.DateTime())) Traceback (most recent call last): File "<stdin>", line 1, in ? AttributeError: 'builtin_function_or_method' object has no attribute 'Time' ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1483018&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2006-05-18 17:33:36
|
Patches item #1491098, was opened at 2006-05-18 21:05 Message generated for change (Comment added) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1491098&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: Invalid Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: test for relative paths for connections Initial Comment: I can't add this to the previous patch/bug so I'm adding it as a new item. I have got a sf account but it won't let me log in. Cheers, ~andy -- Andy Kilner <an...@an...> ---------------------------------------------------------------------- >Comment By: Oleg Broytmann (phd) Date: 2006-05-18 21:33 Message: Logged In: YES user_id=4799 You have forgotten to attach the patch. Probably just forgot to check the checkbox. Please resubmit. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1491098&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2006-05-18 17:21:44
|
Patches item #1483018, was opened at 2006-05-06 08:19 Message generated for change (Comment added) made by russf You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1483018&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 Submitted By: Russ Ferriday (russf) Assigned to: Nobody/Anonymous (nobody) Summary: Play nicely with mxDateTime Initial Comment: Related to version: =========== URL: http://svn.colorstudy.com/SQLObject/trunk Repository UUID: 95a46c32-92d2-0310-94a5-8d71aeb3d4b3 Revision: 1748 Fixes problem: ========= File "/usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py", line 63, in ? TimeType = type(DateTime.Time()) AttributeError: 'module' object has no attribute 'Time' Description: ======== I'm using SQLObject with Zope and Python 2.4. Path to Time is longer than the original code was expecting. And it needs a param - DateTime. Patch: ==== --- col.py.orig 2006-05-05 19:30:39.000000000 +0100 +++ col.py 2006-05-06 16:02:33.000000000 +0100 @@ -60,7 +60,7 @@ if mxdatetime_available: DateTimeType = type(DateTime.now()) - TimeType = type(DateTime.Time()) + TimeType = type(DateTime.DateTime.Time(DateTime.DateTime())) if datetime_available: default_datetime_implementation = DATETIME_IMPLEMENTATION ---------------------------------------------------------------------- >Comment By: Russ Ferriday (russf) Date: 2006-05-18 10:21 Message: Logged In: YES user_id=478441 Thanks for your patience, Oleg, Ian, > Does the confusion here have something to do with Zope's > DateTime module being confused for mx.DateTime? Digging deeper, yes it does. It's Zope's DateTime.py that ends up being imported. (Pdb) print sys.modules['DateTime'] <module 'DateTime' from '/usr/local/zope/zope/lib/python/DateTime/ __init__.pyc'> When I add that kludge as shown in the original patch, Zope and SQLObject work fine together, as far as it goes. And I'm using DateTimeCol in several tables without issues. I'm open to suggestions as how to best handle this. Any more thoughts? ---------------------------------------------------------------------- Comment By: Ian Bicking (ianbicking) Date: 2006-05-18 10:07 Message: Logged In: YES user_id=210337 Does the confusion here have something to do with Zope's DateTime module being confused for mx.DateTime? I don't think we support Zope's DateTime at all; adding support for that would be separate, though I think mx.DateTime is usually available where Zope's DateTime is also available. Anyway, on some level this is definitely a problem with imports, not with the code. "DateTime" is meant to be the mx DateTime module, which contains "now", etc.; if it doesn't contain that, then the import is wrong, not the code. ---------------------------------------------------------------------- Comment By: Russ Ferriday (russf) Date: 2006-05-18 10:01 Message: Logged In: YES user_id=478441 Yes, it helps as far as line 63 when I get this: File "/usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py", line 63, in ? DateTimeType = type(DateTime.now()) AttributeError: class DateTime has no attribute 'now' ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2006-05-18 09:45 Message: Logged In: YES user_id=4799 Can you instead of your fix replace the line 50 import DateTime with from DateTime import DateTime and test if this helps? ---------------------------------------------------------------------- Comment By: Russ Ferriday (russf) Date: 2006-05-18 09:14 Message: Logged In: YES user_id=478441 Thanks for looking at this. OK, so at my command line, explicitly using the same python: /usr/local/zope/python/bin/python Python 2.4.2 (#1, Mar 28 2006, 15:06:21) [GCC 4.0.0 20041026 (Apple Computer, Inc. build 4061)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import DateTime Traceback (most recent call last): File "<stdin>", line 1, in ? ImportError: No module named DateTime We see that DateTime is not importable. But this is not relevant to the case when I'm running in zope. This is where pdb comes into its own. I think this adventure is self explanatory: /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(39)?() -> try: (Pdb) l 34 from util.backports import count 35 36 NoDefault = sqlbuilder.NoDefault 37 True, False = 1==1, 0==1 38 import pdb; pdb.set_trace() 39 -> try: 40 import datetime 41 except ImportError: # Python 2.2 42 datetime_available = False 43 else: 44 datetime_available = True (Pdb) import datetime (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(40)?() -> import datetime (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(44)?() -> datetime_available = True (Pdb) l 39 try: 40 import datetime 41 except ImportError: # Python 2.2 42 datetime_available = False 43 else: 44 -> datetime_available = True 45 46 try: 47 from mx import DateTime 48 except ImportError: 49 try: (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(46)?() -> try: (Pdb) l 41 except ImportError: # Python 2.2 42 datetime_available = False 43 else: 44 datetime_available = True 45 46 -> try: 47 from mx import DateTime 48 except ImportError: 49 try: 50 import DateTime # old version of mxDateTime 51 except ImportError: (Pdb) from mx import DateTime *** ImportError: No module named mx (Pdb) import DateTime (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(47)?() -> from mx import DateTime (Pdb) n ImportError: 'No module named mx' > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(47)?() -> from mx import DateTime (Pdb) s > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(48)?() -> except ImportError: (Pdb) s > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(49)?() -> try: (Pdb) l 44 datetime_available = True 45 46 try: 47 from mx import DateTime 48 except ImportError: 49 -> try: 50 import DateTime # old version of mxDateTime 51 except ImportError: 52 mxdatetime_available = False 53 else: 54 mxdatetime_available = True (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(50)?() -> import DateTime # old version of mxDateTime (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(54)?() -> mxdatetime_available = True (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(58)?() -> DATETIME_IMPLEMENTATION = "datetime" (Pdb) l 53 else: 54 mxdatetime_available = True 55 else: 56 mxdatetime_available = True 57 58 -> DATETIME_IMPLEMENTATION = "datetime" 59 MXDATETIME_IMPLEMENTATION = "mxDateTime" 60 61 if mxdatetime_available: 62 DateTimeType = type(DateTime.now()) 63 TimeType = type(DateTime.DateTime.Time(DateTime.DateTime())) (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(59)?() -> MXDATETIME_IMPLEMENTATION = "mxDateTime" (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(61)?() -> if mxdatetime_available: (Pdb) l 56 mxdatetime_available = True 57 58 DATETIME_IMPLEMENTATION = "datetime" 59 MXDATETIME_IMPLEMENTATION = "mxDateTime" 60 61 -> if mxdatetime_available: 62 DateTimeType = type(DateTime.now()) 63 TimeType = type(DateTime.DateTime.Time(DateTime.DateTime())) 64 65 if datetime_available: 66 default_datetime_implementation = DATETIME_IMPLEMENTATION (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(62)?() -> DateTimeType = type(DateTime.now()) (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(63)?() -> TimeType = type(DateTime.DateTime.Time(DateTime.DateTime())) (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(65)?() -> if datetime_available: ... (Pdb) print sys.modules['DateTime'] <module 'DateTime' from '/usr/local/zope/zope/lib/python/DateTime/ __init__.pyc'> (Pdb) As you can see, in this context the changes give a valid Time Type, and SQLObject runs nicely. Without the changes, I get the message in the original post. I think my title was very misleading. What I'm actually doing is accomodating the "old" DateTime module, as mentioned on line 50. Is there some middle ground to make it possible to run SQLObject in Zope without patches? ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2006-05-18 08:03 Message: Logged In: YES user_id=4799 The patch is invalid. Try this from the command line: > python Python 2.4.3 (#2, Apr 4 2006, 23:50:10) [GCC 3.3.5 (Debian 1:3.3.5-13)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx import DateTime >>> print type(DateTime.Time()) <type 'DateTimeDelta'> >>> print type(DateTime.DateTime.Time(DateTime.DateTime())) Traceback (most recent call last): File "<stdin>", line 1, in ? AttributeError: 'builtin_function_or_method' object has no attribute 'Time' ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1483018&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2006-05-18 17:07:10
|
Patches item #1483018, was opened at 2006-05-06 10:19 Message generated for change (Comment added) made by ianbicking You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1483018&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 Submitted By: Russ Ferriday (russf) Assigned to: Nobody/Anonymous (nobody) Summary: Play nicely with mxDateTime Initial Comment: Related to version: =========== URL: http://svn.colorstudy.com/SQLObject/trunk Repository UUID: 95a46c32-92d2-0310-94a5-8d71aeb3d4b3 Revision: 1748 Fixes problem: ========= File "/usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py", line 63, in ? TimeType = type(DateTime.Time()) AttributeError: 'module' object has no attribute 'Time' Description: ======== I'm using SQLObject with Zope and Python 2.4. Path to Time is longer than the original code was expecting. And it needs a param - DateTime. Patch: ==== --- col.py.orig 2006-05-05 19:30:39.000000000 +0100 +++ col.py 2006-05-06 16:02:33.000000000 +0100 @@ -60,7 +60,7 @@ if mxdatetime_available: DateTimeType = type(DateTime.now()) - TimeType = type(DateTime.Time()) + TimeType = type(DateTime.DateTime.Time(DateTime.DateTime())) if datetime_available: default_datetime_implementation = DATETIME_IMPLEMENTATION ---------------------------------------------------------------------- >Comment By: Ian Bicking (ianbicking) Date: 2006-05-18 12:07 Message: Logged In: YES user_id=210337 Does the confusion here have something to do with Zope's DateTime module being confused for mx.DateTime? I don't think we support Zope's DateTime at all; adding support for that would be separate, though I think mx.DateTime is usually available where Zope's DateTime is also available. Anyway, on some level this is definitely a problem with imports, not with the code. "DateTime" is meant to be the mx DateTime module, which contains "now", etc.; if it doesn't contain that, then the import is wrong, not the code. ---------------------------------------------------------------------- Comment By: Russ Ferriday (russf) Date: 2006-05-18 12:01 Message: Logged In: YES user_id=478441 Yes, it helps as far as line 63 when I get this: File "/usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py", line 63, in ? DateTimeType = type(DateTime.now()) AttributeError: class DateTime has no attribute 'now' ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2006-05-18 11:45 Message: Logged In: YES user_id=4799 Can you instead of your fix replace the line 50 import DateTime with from DateTime import DateTime and test if this helps? ---------------------------------------------------------------------- Comment By: Russ Ferriday (russf) Date: 2006-05-18 11:14 Message: Logged In: YES user_id=478441 Thanks for looking at this. OK, so at my command line, explicitly using the same python: /usr/local/zope/python/bin/python Python 2.4.2 (#1, Mar 28 2006, 15:06:21) [GCC 4.0.0 20041026 (Apple Computer, Inc. build 4061)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import DateTime Traceback (most recent call last): File "<stdin>", line 1, in ? ImportError: No module named DateTime We see that DateTime is not importable. But this is not relevant to the case when I'm running in zope. This is where pdb comes into its own. I think this adventure is self explanatory: /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(39)?() -> try: (Pdb) l 34 from util.backports import count 35 36 NoDefault = sqlbuilder.NoDefault 37 True, False = 1==1, 0==1 38 import pdb; pdb.set_trace() 39 -> try: 40 import datetime 41 except ImportError: # Python 2.2 42 datetime_available = False 43 else: 44 datetime_available = True (Pdb) import datetime (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(40)?() -> import datetime (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(44)?() -> datetime_available = True (Pdb) l 39 try: 40 import datetime 41 except ImportError: # Python 2.2 42 datetime_available = False 43 else: 44 -> datetime_available = True 45 46 try: 47 from mx import DateTime 48 except ImportError: 49 try: (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(46)?() -> try: (Pdb) l 41 except ImportError: # Python 2.2 42 datetime_available = False 43 else: 44 datetime_available = True 45 46 -> try: 47 from mx import DateTime 48 except ImportError: 49 try: 50 import DateTime # old version of mxDateTime 51 except ImportError: (Pdb) from mx import DateTime *** ImportError: No module named mx (Pdb) import DateTime (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(47)?() -> from mx import DateTime (Pdb) n ImportError: 'No module named mx' > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(47)?() -> from mx import DateTime (Pdb) s > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(48)?() -> except ImportError: (Pdb) s > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(49)?() -> try: (Pdb) l 44 datetime_available = True 45 46 try: 47 from mx import DateTime 48 except ImportError: 49 -> try: 50 import DateTime # old version of mxDateTime 51 except ImportError: 52 mxdatetime_available = False 53 else: 54 mxdatetime_available = True (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(50)?() -> import DateTime # old version of mxDateTime (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(54)?() -> mxdatetime_available = True (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(58)?() -> DATETIME_IMPLEMENTATION = "datetime" (Pdb) l 53 else: 54 mxdatetime_available = True 55 else: 56 mxdatetime_available = True 57 58 -> DATETIME_IMPLEMENTATION = "datetime" 59 MXDATETIME_IMPLEMENTATION = "mxDateTime" 60 61 if mxdatetime_available: 62 DateTimeType = type(DateTime.now()) 63 TimeType = type(DateTime.DateTime.Time(DateTime.DateTime())) (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(59)?() -> MXDATETIME_IMPLEMENTATION = "mxDateTime" (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(61)?() -> if mxdatetime_available: (Pdb) l 56 mxdatetime_available = True 57 58 DATETIME_IMPLEMENTATION = "datetime" 59 MXDATETIME_IMPLEMENTATION = "mxDateTime" 60 61 -> if mxdatetime_available: 62 DateTimeType = type(DateTime.now()) 63 TimeType = type(DateTime.DateTime.Time(DateTime.DateTime())) 64 65 if datetime_available: 66 default_datetime_implementation = DATETIME_IMPLEMENTATION (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(62)?() -> DateTimeType = type(DateTime.now()) (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(63)?() -> TimeType = type(DateTime.DateTime.Time(DateTime.DateTime())) (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(65)?() -> if datetime_available: ... (Pdb) print sys.modules['DateTime'] <module 'DateTime' from '/usr/local/zope/zope/lib/python/DateTime/ __init__.pyc'> (Pdb) As you can see, in this context the changes give a valid Time Type, and SQLObject runs nicely. Without the changes, I get the message in the original post. I think my title was very misleading. What I'm actually doing is accomodating the "old" DateTime module, as mentioned on line 50. Is there some middle ground to make it possible to run SQLObject in Zope without patches? ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2006-05-18 10:03 Message: Logged In: YES user_id=4799 The patch is invalid. Try this from the command line: > python Python 2.4.3 (#2, Apr 4 2006, 23:50:10) [GCC 3.3.5 (Debian 1:3.3.5-13)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx import DateTime >>> print type(DateTime.Time()) <type 'DateTimeDelta'> >>> print type(DateTime.DateTime.Time(DateTime.DateTime())) Traceback (most recent call last): File "<stdin>", line 1, in ? AttributeError: 'builtin_function_or_method' object has no attribute 'Time' ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1483018&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2006-05-18 17:05:45
|
Patches item #1491098, was opened at 2006-05-18 10:05 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1491098&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 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: test for relative paths for connections Initial Comment: I can't add this to the previous patch/bug so I'm adding it as a new item. I have got a sf account but it won't let me log in. Cheers, ~andy -- Andy Kilner <an...@an...> ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1491098&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2006-05-18 17:01:58
|
Patches item #1483018, was opened at 2006-05-06 08:19 Message generated for change (Comment added) made by russf You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1483018&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 Submitted By: Russ Ferriday (russf) Assigned to: Nobody/Anonymous (nobody) Summary: Play nicely with mxDateTime Initial Comment: Related to version: =========== URL: http://svn.colorstudy.com/SQLObject/trunk Repository UUID: 95a46c32-92d2-0310-94a5-8d71aeb3d4b3 Revision: 1748 Fixes problem: ========= File "/usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py", line 63, in ? TimeType = type(DateTime.Time()) AttributeError: 'module' object has no attribute 'Time' Description: ======== I'm using SQLObject with Zope and Python 2.4. Path to Time is longer than the original code was expecting. And it needs a param - DateTime. Patch: ==== --- col.py.orig 2006-05-05 19:30:39.000000000 +0100 +++ col.py 2006-05-06 16:02:33.000000000 +0100 @@ -60,7 +60,7 @@ if mxdatetime_available: DateTimeType = type(DateTime.now()) - TimeType = type(DateTime.Time()) + TimeType = type(DateTime.DateTime.Time(DateTime.DateTime())) if datetime_available: default_datetime_implementation = DATETIME_IMPLEMENTATION ---------------------------------------------------------------------- >Comment By: Russ Ferriday (russf) Date: 2006-05-18 10:01 Message: Logged In: YES user_id=478441 Yes, it helps as far as line 63 when I get this: File "/usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py", line 63, in ? DateTimeType = type(DateTime.now()) AttributeError: class DateTime has no attribute 'now' ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2006-05-18 09:45 Message: Logged In: YES user_id=4799 Can you instead of your fix replace the line 50 import DateTime with from DateTime import DateTime and test if this helps? ---------------------------------------------------------------------- Comment By: Russ Ferriday (russf) Date: 2006-05-18 09:14 Message: Logged In: YES user_id=478441 Thanks for looking at this. OK, so at my command line, explicitly using the same python: /usr/local/zope/python/bin/python Python 2.4.2 (#1, Mar 28 2006, 15:06:21) [GCC 4.0.0 20041026 (Apple Computer, Inc. build 4061)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import DateTime Traceback (most recent call last): File "<stdin>", line 1, in ? ImportError: No module named DateTime We see that DateTime is not importable. But this is not relevant to the case when I'm running in zope. This is where pdb comes into its own. I think this adventure is self explanatory: /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(39)?() -> try: (Pdb) l 34 from util.backports import count 35 36 NoDefault = sqlbuilder.NoDefault 37 True, False = 1==1, 0==1 38 import pdb; pdb.set_trace() 39 -> try: 40 import datetime 41 except ImportError: # Python 2.2 42 datetime_available = False 43 else: 44 datetime_available = True (Pdb) import datetime (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(40)?() -> import datetime (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(44)?() -> datetime_available = True (Pdb) l 39 try: 40 import datetime 41 except ImportError: # Python 2.2 42 datetime_available = False 43 else: 44 -> datetime_available = True 45 46 try: 47 from mx import DateTime 48 except ImportError: 49 try: (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(46)?() -> try: (Pdb) l 41 except ImportError: # Python 2.2 42 datetime_available = False 43 else: 44 datetime_available = True 45 46 -> try: 47 from mx import DateTime 48 except ImportError: 49 try: 50 import DateTime # old version of mxDateTime 51 except ImportError: (Pdb) from mx import DateTime *** ImportError: No module named mx (Pdb) import DateTime (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(47)?() -> from mx import DateTime (Pdb) n ImportError: 'No module named mx' > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(47)?() -> from mx import DateTime (Pdb) s > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(48)?() -> except ImportError: (Pdb) s > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(49)?() -> try: (Pdb) l 44 datetime_available = True 45 46 try: 47 from mx import DateTime 48 except ImportError: 49 -> try: 50 import DateTime # old version of mxDateTime 51 except ImportError: 52 mxdatetime_available = False 53 else: 54 mxdatetime_available = True (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(50)?() -> import DateTime # old version of mxDateTime (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(54)?() -> mxdatetime_available = True (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(58)?() -> DATETIME_IMPLEMENTATION = "datetime" (Pdb) l 53 else: 54 mxdatetime_available = True 55 else: 56 mxdatetime_available = True 57 58 -> DATETIME_IMPLEMENTATION = "datetime" 59 MXDATETIME_IMPLEMENTATION = "mxDateTime" 60 61 if mxdatetime_available: 62 DateTimeType = type(DateTime.now()) 63 TimeType = type(DateTime.DateTime.Time(DateTime.DateTime())) (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(59)?() -> MXDATETIME_IMPLEMENTATION = "mxDateTime" (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(61)?() -> if mxdatetime_available: (Pdb) l 56 mxdatetime_available = True 57 58 DATETIME_IMPLEMENTATION = "datetime" 59 MXDATETIME_IMPLEMENTATION = "mxDateTime" 60 61 -> if mxdatetime_available: 62 DateTimeType = type(DateTime.now()) 63 TimeType = type(DateTime.DateTime.Time(DateTime.DateTime())) 64 65 if datetime_available: 66 default_datetime_implementation = DATETIME_IMPLEMENTATION (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(62)?() -> DateTimeType = type(DateTime.now()) (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(63)?() -> TimeType = type(DateTime.DateTime.Time(DateTime.DateTime())) (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(65)?() -> if datetime_available: ... (Pdb) print sys.modules['DateTime'] <module 'DateTime' from '/usr/local/zope/zope/lib/python/DateTime/ __init__.pyc'> (Pdb) As you can see, in this context the changes give a valid Time Type, and SQLObject runs nicely. Without the changes, I get the message in the original post. I think my title was very misleading. What I'm actually doing is accomodating the "old" DateTime module, as mentioned on line 50. Is there some middle ground to make it possible to run SQLObject in Zope without patches? ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2006-05-18 08:03 Message: Logged In: YES user_id=4799 The patch is invalid. Try this from the command line: > python Python 2.4.3 (#2, Apr 4 2006, 23:50:10) [GCC 3.3.5 (Debian 1:3.3.5-13)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx import DateTime >>> print type(DateTime.Time()) <type 'DateTimeDelta'> >>> print type(DateTime.DateTime.Time(DateTime.DateTime())) Traceback (most recent call last): File "<stdin>", line 1, in ? AttributeError: 'builtin_function_or_method' object has no attribute 'Time' ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1483018&group_id=74338 |
|
From: <sub...@co...> - 2006-05-18 16:54:50
|
Author: phd Date: 2006-05-18 10:54:44 -0600 (Thu, 18 May 2006) New Revision: 1776 Modified: SQLObject/branches/0.7-bugfix/docs/FAQ.txt Log: Copied the question "Why there is no __len__?" and the answer from the trunk. Modified: SQLObject/branches/0.7-bugfix/docs/FAQ.txt =================================================================== --- SQLObject/branches/0.7-bugfix/docs/FAQ.txt 2006-05-18 16:53:07 UTC (rev 1775) +++ SQLObject/branches/0.7-bugfix/docs/FAQ.txt 2006-05-18 16:54:44 UTC (rev 1776) @@ -4,6 +4,25 @@ .. contents:: +Why there is no __len__? +------------------------ + +There are reasons why there is no __len__ method, though many people think +having those make them feel more integrated into Python. + +One is that len(foo) is expected to be fast, but issuing a COUNT query can +be slow. Worse, often this causes the database to do essentially redundant +work when the actual query is performed (generally taking the len of a +sequence is followed by accessing items from that sequence). + +Another is that list(foo) implicitly tries to do a len first, as an +optimization (because len is expected to be cheap -- see previous point). +Worse, it swallows *all* exceptions that occur during that call to __len__, +so if it fails (e.g. there's a typo somewhere in the query), the original +cause is silently discarded, and instead you're left with mysterious errors +like "current transaction is aborted, commands ignored until end of +transaction block" for no apparent reason. + How can I do a LEFT JOIN? ------------------------- |
|
From: <sub...@co...> - 2006-05-18 16:53:16
|
Author: phd
Date: 2006-05-18 10:53:07 -0600 (Thu, 18 May 2006)
New Revision: 1775
Modified:
home/phd/SQLObject/paramstyles/sqlobject/main.py
Log:
Merged patches from the revisions 1772:1774 from the trunk
Modified: home/phd/SQLObject/paramstyles/sqlobject/main.py
===================================================================
--- home/phd/SQLObject/paramstyles/sqlobject/main.py 2006-05-18 16:51:33 UTC (rev 1774)
+++ home/phd/SQLObject/paramstyles/sqlobject/main.py 2006-05-18 16:53:07 UTC (rev 1775)
@@ -1383,9 +1383,13 @@
conn = connection or cls._connection
sql, constraints = conn.createTableSQL(cls)
if createJoinTables:
- sql += '\n' + cls.createJoinTablesSQL(connection=conn)
+ join_sql = cls.createJoinTablesSQL(connection=conn)
+ if join_sql:
+ sql = ';\n' + join_sql
if createIndexes:
- sql += '\n' + cls.createIndexesSQL(connection=conn)
+ index_sql = cls.createIndexesSQL(connection=conn)
+ if index_sql:
+ sql += ';\n' + index_sql
return sql, constraints
createTableSQL = classmethod(createTableSQL)
|
|
From: SourceForge.net <no...@so...> - 2006-05-18 16:52:10
|
Bugs item #1421647, was opened at 2006-02-01 19:59 Message generated for change (Comment added) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1421647&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 from repository >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Daniel Holth (joeforker) >Assigned to: Oleg Broytmann (phd) Summary: sqlobject-manager sql (show create-table commands) semicolon Initial Comment: Hi, I'm playing with turboblog (http://svn.turboblog.python-hosting.com/turboblog) with postgresql as the database. sqlobject-manager will print my database CREATE TABLE () but it's severely lacking in ; . This would be okay except for some reason it does not create the tables correctly in the normal way. So I must print the CREATE TABLE commands, add the necessary semicolons, and run it through psql. Notice the linkage tables are created with the same function call as the main table. Then the 'sql' command of sqlobject-admin (sqlobject/manager/command.py line 495) adds one semicolon for the group. CREATE TABLE tg_group ( id SERIAL PRIMARY KEY, child_name VARCHAR(255), group_id VARCHAR(16) NOT NULL UNIQUE, display_name VARCHAR(255), created TIMESTAMP ) CREATE TABLE tg_user_group ( group_id INT NOT NULL, user_id INT NOT NULL ) CREATE TABLE tg_group_permission ( group_id INT NOT NULL, permission_id INT NOT NULL ); ---------------------------------------------------------------------- >Comment By: Oleg Broytmann (phd) Date: 2006-05-18 20:52 Message: Logged In: YES user_id=4799 Applied the fix from http://trac.turbogears.org/turbogears/ticket/738 . Commiedt in the revision 1774. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2006-05-02 18:18 Message: Logged In: NO Please also see: http://trac.turbogears.org/turbogears/ticket/738 Cheers Roger ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1421647&group_id=74338 |
|
From: <sub...@co...> - 2006-05-18 16:51:44
|
Author: phd Date: 2006-05-18 10:51:33 -0600 (Thu, 18 May 2006) New Revision: 1774 Modified: SQLObject/trunk/sqlobject/main.py Log: Applied the fix from http://trac.turbogears.org/turbogears/ticket/738 for the bug https://sourceforge.net/tracker/index.php?func=detail&aid=1421647&group_id=74338&atid=540672 Modified: SQLObject/trunk/sqlobject/main.py =================================================================== --- SQLObject/trunk/sqlobject/main.py 2006-05-17 20:51:57 UTC (rev 1773) +++ SQLObject/trunk/sqlobject/main.py 2006-05-18 16:51:33 UTC (rev 1774) @@ -1383,9 +1383,13 @@ conn = connection or cls._connection sql, constraints = conn.createTableSQL(cls) if createJoinTables: - sql += '\n' + cls.createJoinTablesSQL(connection=conn) + join_sql = cls.createJoinTablesSQL(connection=conn) + if join_sql: + sql = ';\n' + join_sql if createIndexes: - sql += '\n' + cls.createIndexesSQL(connection=conn) + index_sql = cls.createIndexesSQL(connection=conn) + if index_sql: + sql += ';\n' + index_sql return sql, constraints createTableSQL = classmethod(createTableSQL) |
|
From: SourceForge.net <no...@so...> - 2006-05-18 16:45:14
|
Patches item #1483018, was opened at 2006-05-06 19:19 Message generated for change (Comment added) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1483018&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 Submitted By: Russ Ferriday (russf) Assigned to: Nobody/Anonymous (nobody) Summary: Play nicely with mxDateTime Initial Comment: Related to version: =========== URL: http://svn.colorstudy.com/SQLObject/trunk Repository UUID: 95a46c32-92d2-0310-94a5-8d71aeb3d4b3 Revision: 1748 Fixes problem: ========= File "/usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py", line 63, in ? TimeType = type(DateTime.Time()) AttributeError: 'module' object has no attribute 'Time' Description: ======== I'm using SQLObject with Zope and Python 2.4. Path to Time is longer than the original code was expecting. And it needs a param - DateTime. Patch: ==== --- col.py.orig 2006-05-05 19:30:39.000000000 +0100 +++ col.py 2006-05-06 16:02:33.000000000 +0100 @@ -60,7 +60,7 @@ if mxdatetime_available: DateTimeType = type(DateTime.now()) - TimeType = type(DateTime.Time()) + TimeType = type(DateTime.DateTime.Time(DateTime.DateTime())) if datetime_available: default_datetime_implementation = DATETIME_IMPLEMENTATION ---------------------------------------------------------------------- >Comment By: Oleg Broytmann (phd) Date: 2006-05-18 20:45 Message: Logged In: YES user_id=4799 Can you instead of your fix replace the line 50 import DateTime with from DateTime import DateTime and test if this helps? ---------------------------------------------------------------------- Comment By: Russ Ferriday (russf) Date: 2006-05-18 20:14 Message: Logged In: YES user_id=478441 Thanks for looking at this. OK, so at my command line, explicitly using the same python: /usr/local/zope/python/bin/python Python 2.4.2 (#1, Mar 28 2006, 15:06:21) [GCC 4.0.0 20041026 (Apple Computer, Inc. build 4061)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import DateTime Traceback (most recent call last): File "<stdin>", line 1, in ? ImportError: No module named DateTime We see that DateTime is not importable. But this is not relevant to the case when I'm running in zope. This is where pdb comes into its own. I think this adventure is self explanatory: /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(39)?() -> try: (Pdb) l 34 from util.backports import count 35 36 NoDefault = sqlbuilder.NoDefault 37 True, False = 1==1, 0==1 38 import pdb; pdb.set_trace() 39 -> try: 40 import datetime 41 except ImportError: # Python 2.2 42 datetime_available = False 43 else: 44 datetime_available = True (Pdb) import datetime (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(40)?() -> import datetime (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(44)?() -> datetime_available = True (Pdb) l 39 try: 40 import datetime 41 except ImportError: # Python 2.2 42 datetime_available = False 43 else: 44 -> datetime_available = True 45 46 try: 47 from mx import DateTime 48 except ImportError: 49 try: (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(46)?() -> try: (Pdb) l 41 except ImportError: # Python 2.2 42 datetime_available = False 43 else: 44 datetime_available = True 45 46 -> try: 47 from mx import DateTime 48 except ImportError: 49 try: 50 import DateTime # old version of mxDateTime 51 except ImportError: (Pdb) from mx import DateTime *** ImportError: No module named mx (Pdb) import DateTime (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(47)?() -> from mx import DateTime (Pdb) n ImportError: 'No module named mx' > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(47)?() -> from mx import DateTime (Pdb) s > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(48)?() -> except ImportError: (Pdb) s > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(49)?() -> try: (Pdb) l 44 datetime_available = True 45 46 try: 47 from mx import DateTime 48 except ImportError: 49 -> try: 50 import DateTime # old version of mxDateTime 51 except ImportError: 52 mxdatetime_available = False 53 else: 54 mxdatetime_available = True (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(50)?() -> import DateTime # old version of mxDateTime (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(54)?() -> mxdatetime_available = True (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(58)?() -> DATETIME_IMPLEMENTATION = "datetime" (Pdb) l 53 else: 54 mxdatetime_available = True 55 else: 56 mxdatetime_available = True 57 58 -> DATETIME_IMPLEMENTATION = "datetime" 59 MXDATETIME_IMPLEMENTATION = "mxDateTime" 60 61 if mxdatetime_available: 62 DateTimeType = type(DateTime.now()) 63 TimeType = type(DateTime.DateTime.Time(DateTime.DateTime())) (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(59)?() -> MXDATETIME_IMPLEMENTATION = "mxDateTime" (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(61)?() -> if mxdatetime_available: (Pdb) l 56 mxdatetime_available = True 57 58 DATETIME_IMPLEMENTATION = "datetime" 59 MXDATETIME_IMPLEMENTATION = "mxDateTime" 60 61 -> if mxdatetime_available: 62 DateTimeType = type(DateTime.now()) 63 TimeType = type(DateTime.DateTime.Time(DateTime.DateTime())) 64 65 if datetime_available: 66 default_datetime_implementation = DATETIME_IMPLEMENTATION (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(62)?() -> DateTimeType = type(DateTime.now()) (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(63)?() -> TimeType = type(DateTime.DateTime.Time(DateTime.DateTime())) (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(65)?() -> if datetime_available: ... (Pdb) print sys.modules['DateTime'] <module 'DateTime' from '/usr/local/zope/zope/lib/python/DateTime/ __init__.pyc'> (Pdb) As you can see, in this context the changes give a valid Time Type, and SQLObject runs nicely. Without the changes, I get the message in the original post. I think my title was very misleading. What I'm actually doing is accomodating the "old" DateTime module, as mentioned on line 50. Is there some middle ground to make it possible to run SQLObject in Zope without patches? ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2006-05-18 19:03 Message: Logged In: YES user_id=4799 The patch is invalid. Try this from the command line: > python Python 2.4.3 (#2, Apr 4 2006, 23:50:10) [GCC 3.3.5 (Debian 1:3.3.5-13)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx import DateTime >>> print type(DateTime.Time()) <type 'DateTimeDelta'> >>> print type(DateTime.DateTime.Time(DateTime.DateTime())) Traceback (most recent call last): File "<stdin>", line 1, in ? AttributeError: 'builtin_function_or_method' object has no attribute 'Time' ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1483018&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2006-05-18 16:14:47
|
Patches item #1483018, was opened at 2006-05-06 08:19 Message generated for change (Comment added) made by russf You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1483018&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: Invalid Priority: 5 Submitted By: Russ Ferriday (russf) Assigned to: Nobody/Anonymous (nobody) Summary: Play nicely with mxDateTime Initial Comment: Related to version: =========== URL: http://svn.colorstudy.com/SQLObject/trunk Repository UUID: 95a46c32-92d2-0310-94a5-8d71aeb3d4b3 Revision: 1748 Fixes problem: ========= File "/usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py", line 63, in ? TimeType = type(DateTime.Time()) AttributeError: 'module' object has no attribute 'Time' Description: ======== I'm using SQLObject with Zope and Python 2.4. Path to Time is longer than the original code was expecting. And it needs a param - DateTime. Patch: ==== --- col.py.orig 2006-05-05 19:30:39.000000000 +0100 +++ col.py 2006-05-06 16:02:33.000000000 +0100 @@ -60,7 +60,7 @@ if mxdatetime_available: DateTimeType = type(DateTime.now()) - TimeType = type(DateTime.Time()) + TimeType = type(DateTime.DateTime.Time(DateTime.DateTime())) if datetime_available: default_datetime_implementation = DATETIME_IMPLEMENTATION ---------------------------------------------------------------------- >Comment By: Russ Ferriday (russf) Date: 2006-05-18 09:14 Message: Logged In: YES user_id=478441 Thanks for looking at this. OK, so at my command line, explicitly using the same python: /usr/local/zope/python/bin/python Python 2.4.2 (#1, Mar 28 2006, 15:06:21) [GCC 4.0.0 20041026 (Apple Computer, Inc. build 4061)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import DateTime Traceback (most recent call last): File "<stdin>", line 1, in ? ImportError: No module named DateTime We see that DateTime is not importable. But this is not relevant to the case when I'm running in zope. This is where pdb comes into its own. I think this adventure is self explanatory: /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(39)?() -> try: (Pdb) l 34 from util.backports import count 35 36 NoDefault = sqlbuilder.NoDefault 37 True, False = 1==1, 0==1 38 import pdb; pdb.set_trace() 39 -> try: 40 import datetime 41 except ImportError: # Python 2.2 42 datetime_available = False 43 else: 44 datetime_available = True (Pdb) import datetime (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(40)?() -> import datetime (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(44)?() -> datetime_available = True (Pdb) l 39 try: 40 import datetime 41 except ImportError: # Python 2.2 42 datetime_available = False 43 else: 44 -> datetime_available = True 45 46 try: 47 from mx import DateTime 48 except ImportError: 49 try: (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(46)?() -> try: (Pdb) l 41 except ImportError: # Python 2.2 42 datetime_available = False 43 else: 44 datetime_available = True 45 46 -> try: 47 from mx import DateTime 48 except ImportError: 49 try: 50 import DateTime # old version of mxDateTime 51 except ImportError: (Pdb) from mx import DateTime *** ImportError: No module named mx (Pdb) import DateTime (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(47)?() -> from mx import DateTime (Pdb) n ImportError: 'No module named mx' > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(47)?() -> from mx import DateTime (Pdb) s > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(48)?() -> except ImportError: (Pdb) s > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(49)?() -> try: (Pdb) l 44 datetime_available = True 45 46 try: 47 from mx import DateTime 48 except ImportError: 49 -> try: 50 import DateTime # old version of mxDateTime 51 except ImportError: 52 mxdatetime_available = False 53 else: 54 mxdatetime_available = True (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(50)?() -> import DateTime # old version of mxDateTime (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(54)?() -> mxdatetime_available = True (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(58)?() -> DATETIME_IMPLEMENTATION = "datetime" (Pdb) l 53 else: 54 mxdatetime_available = True 55 else: 56 mxdatetime_available = True 57 58 -> DATETIME_IMPLEMENTATION = "datetime" 59 MXDATETIME_IMPLEMENTATION = "mxDateTime" 60 61 if mxdatetime_available: 62 DateTimeType = type(DateTime.now()) 63 TimeType = type(DateTime.DateTime.Time(DateTime.DateTime())) (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(59)?() -> MXDATETIME_IMPLEMENTATION = "mxDateTime" (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(61)?() -> if mxdatetime_available: (Pdb) l 56 mxdatetime_available = True 57 58 DATETIME_IMPLEMENTATION = "datetime" 59 MXDATETIME_IMPLEMENTATION = "mxDateTime" 60 61 -> if mxdatetime_available: 62 DateTimeType = type(DateTime.now()) 63 TimeType = type(DateTime.DateTime.Time(DateTime.DateTime())) 64 65 if datetime_available: 66 default_datetime_implementation = DATETIME_IMPLEMENTATION (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(62)?() -> DateTimeType = type(DateTime.now()) (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(63)?() -> TimeType = type(DateTime.DateTime.Time(DateTime.DateTime())) (Pdb) n > /usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py(65)?() -> if datetime_available: ... (Pdb) print sys.modules['DateTime'] <module 'DateTime' from '/usr/local/zope/zope/lib/python/DateTime/ __init__.pyc'> (Pdb) As you can see, in this context the changes give a valid Time Type, and SQLObject runs nicely. Without the changes, I get the message in the original post. I think my title was very misleading. What I'm actually doing is accomodating the "old" DateTime module, as mentioned on line 50. Is there some middle ground to make it possible to run SQLObject in Zope without patches? ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2006-05-18 08:03 Message: Logged In: YES user_id=4799 The patch is invalid. Try this from the command line: > python Python 2.4.3 (#2, Apr 4 2006, 23:50:10) [GCC 3.3.5 (Debian 1:3.3.5-13)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx import DateTime >>> print type(DateTime.Time()) <type 'DateTimeDelta'> >>> print type(DateTime.DateTime.Time(DateTime.DateTime())) Traceback (most recent call last): File "<stdin>", line 1, in ? AttributeError: 'builtin_function_or_method' object has no attribute 'Time' ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1483018&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2006-05-18 16:02:19
|
Bugs item #1417934, was opened at 2006-01-29 15:43 Message generated for change (Settings changed) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1417934&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: Wont Fix Priority: 5 Submitted By: Maxim F. Ischenko (mfi) Assigned to: Nobody/Anonymous (nobody) Summary: Latest SQLObject breaks Turbogears Initial Comment: Latest SQLObject breaks "tg-admin sql record" command. See http://trac.turbogears.org/turbogears/ticket/458 for more info. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1417934&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2006-05-18 15:41:17
|
Bugs item #1415402, was opened at 2006-01-26 16:17 Message generated for change (Comment added) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1415402&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: Wont Fix Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: sqlmeta's addJoin ignores joinMethodName Initial Comment: 1. Started with a dbase .py with something like this; --- class <existing_table>( SQLObject ): .. bla .. .. bla .. .. bla .. --- 2. then I added: --- class <new_relation>( SQLObject ): .. bla .. .. bla .. --- 3. Then I did: python from my_dbase import existing_table, new_relation existing_table.sqlmeta.addJoin( RelatedJoin( 'new_relation', joinMethodName='lookatmynewclass' ) ) 4. Then I changed my initial setup to: --- class <existing_table>( SQLObject ): .. bla .. .. bla .. .. bla .. lookatmynewclass = RelatedJoin( 'new_relation' ) --- 5. Now when I do: --- my_object = existing_table.selectBy( mywhatever='something' ) print dir( my_object ) --- There is a attribute "new_relations" (new class + 's') instead of (what I expected) "lookatmynewclass". 6. I have worked around this by changing my class definition to: --- class <existing_table>( SQLObject ): .. bla .. .. bla .. .. bla .. lookatmynewclass = RelatedJoin( 'new_relation', joinMethodName='lookatmynewclass' ) --- ---------------------------------------------------------------------- >Comment By: Oleg Broytmann (phd) Date: 2006-05-18 19:41 Message: Logged In: YES user_id=4799 I don't see any bugs here. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1415402&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2006-05-18 15:37:52
|
Bugs item #1414773, was opened at 2006-01-25 20:06 Message generated for change (Comment added) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1414773&group_id=74338 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: MySQL Group: SQLObject from repository Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Default values aren't typed in MySQL tables w/ fromDatabase Initial Comment: The default values given in a MySQL table are passed in as string values in the the 'MySQLConnection.columnsFromSchema' method. For example, a simple table that describes a column like so: age INT NOT NULL DEFAULT 0 ...will actually create a IntCol object whose default is '0' (stringified zero). Attached is a local patch I have to handle the various numeric and date/ time columns. Will follow-up with additional tests to verify the changes... ---------- Using Python 2.4.1 and SQLObject r1536 URL: http://svn.colorstudy.com/SQLObject/trunk Repository UUID: 95a46c32-92d2-0310-94a5-8d71aeb3d4b3 Revision: 1536 ---------------------------------------------------------------------- >Comment By: Oleg Broytmann (phd) Date: 2006-05-18 19:37 Message: Logged In: YES user_id=4799 The patch is almost good, except for datetime. The patch used datetime which is not available in Python 2.2 (SQLObject still supports Python 2.2). Please use the same route as in col.py - check what is available and what is prefered by the user. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1414773&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2006-05-18 15:03:55
|
Patches item #1483018, was opened at 2006-05-06 19:19 Message generated for change (Comment added) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1483018&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: Invalid Priority: 5 Submitted By: Russ Ferriday (russf) Assigned to: Nobody/Anonymous (nobody) Summary: Play nicely with mxDateTime Initial Comment: Related to version: =========== URL: http://svn.colorstudy.com/SQLObject/trunk Repository UUID: 95a46c32-92d2-0310-94a5-8d71aeb3d4b3 Revision: 1748 Fixes problem: ========= File "/usr/local/zope/python/lib/python2.4/site-packages/ SQLObject-0.8dev_r1746-py2.4.egg/sqlobject/col.py", line 63, in ? TimeType = type(DateTime.Time()) AttributeError: 'module' object has no attribute 'Time' Description: ======== I'm using SQLObject with Zope and Python 2.4. Path to Time is longer than the original code was expecting. And it needs a param - DateTime. Patch: ==== --- col.py.orig 2006-05-05 19:30:39.000000000 +0100 +++ col.py 2006-05-06 16:02:33.000000000 +0100 @@ -60,7 +60,7 @@ if mxdatetime_available: DateTimeType = type(DateTime.now()) - TimeType = type(DateTime.Time()) + TimeType = type(DateTime.DateTime.Time(DateTime.DateTime())) if datetime_available: default_datetime_implementation = DATETIME_IMPLEMENTATION ---------------------------------------------------------------------- >Comment By: Oleg Broytmann (phd) Date: 2006-05-18 19:03 Message: Logged In: YES user_id=4799 The patch is invalid. Try this from the command line: > python Python 2.4.3 (#2, Apr 4 2006, 23:50:10) [GCC 3.3.5 (Debian 1:3.3.5-13)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from mx import DateTime >>> print type(DateTime.Time()) <type 'DateTimeDelta'> >>> print type(DateTime.DateTime.Time(DateTime.DateTime())) Traceback (most recent call last): File "<stdin>", line 1, in ? AttributeError: 'builtin_function_or_method' object has no attribute 'Time' ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1483018&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2006-05-18 14:59:30
|
Patches item #1482945, was opened at 2006-05-06 13:53 Message generated for change (Comment added) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1482945&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: Fixed Priority: 5 Submitted By: Nobody/Anonymous (nobody) >Assigned to: Oleg Broytmann (phd) Summary: SQLObject 0.7.1 deadlocks on __init__ Initial Comment: If an exception is raised by the underlying DB driver when initializing a new object, the thread lock acquired by threadSafeMethod will never be released. The following patch fixes it. ---------------------------------------------------------------------- >Comment By: Oleg Broytmann (phd) Date: 2006-05-18 18:59 Message: Logged In: YES user_id=4799 Fixed in r1758. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1482945&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2006-05-18 14:45:40
|
Patches item #1117732, was opened at 2005-02-07 11:29 Message generated for change (Settings changed) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1117732&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: Out of Date Priority: 5 Submitted By: gian paolo ciceri (zanzi) Assigned to: Nobody/Anonymous (nobody) Summary: preliminary work to enable joins between different dbms Initial Comment: In the patch there's some initial work to enable MultipleJoin and RelatedJoin between objects that are physically located (i.e. the underlying dbms tables that store their data) on two different dbms (say, a mysql for Person and a sqlite for Address), connected with two different db connections. If you modify the tutorial example http://sqlobject.org/docs/ SQLObject.html#one-to-many-relationships and http:// sqlobject.org/docs/SQLObject.html#many-to-many-relationships to displace objects on two different connections you should be able to see what happens. For example, the intermediate table (in RelatedJoin) is replicated between the two connections, and I've still to optimize this point to avoid this need. I've tested the patch in two cases: with two different mysql connections and with one mysql and one sqlite connections. Caveat: transactions are expected *not* to work in this scenario. Please report any bug or other feedback on the ML or directly to me at gp....@ac.... Thanks for your attention, and patience. Bye /gp ---------------------------------------------------------------------- Comment By: gian paolo ciceri (zanzi) Date: 2005-02-07 11:32 Message: Logged In: YES user_id=6932 (I've just forgot to flag the upload checkbox) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1117732&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2006-05-17 19:00:37
|
Bugs item #1490463, was opened at 2006-05-17 14:00 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1490463&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 Submitted By: Shaun McCance (shaunm) Assigned to: Nobody/Anonymous (nobody) Summary: delIndex and getSchema raise AttributeError Initial Comment: Lines 817-818 of main.py contain the following: delIndex = _sqlmeta_attr('delIndex', 2) getSchema = _sqlmeta_attr('getSchema', 2) This makes delIndex and getSchema in an SQLObject instance reference to the corresponding members of sqlmeta, possibly spitting out a DeprecationWarning. But delIndex and getSchema don't exist in sqlmeta. This causes my code to die with an AttributeError when trying to do introspection on SQLObject-derived classes. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1490463&group_id=74338 |
|
From: <sub...@co...> - 2006-05-17 18:14:42
|
Author: phd Date: 2006-05-17 12:14:37 -0600 (Wed, 17 May 2006) New Revision: 1772 Modified: SQLObject/branches/0.7-bugfix/docs/TODO.txt Log: Merged TODO from the trunk. Modified: SQLObject/branches/0.7-bugfix/docs/TODO.txt =================================================================== --- SQLObject/branches/0.7-bugfix/docs/TODO.txt 2006-05-17 18:13:35 UTC (rev 1771) +++ SQLObject/branches/0.7-bugfix/docs/TODO.txt 2006-05-17 18:14:37 UTC (rev 1772) @@ -4,16 +4,41 @@ * ``_fromDatabase`` currently doesn't support IDs that don't fit into the normal naming scheme. It should do so. You can still use ``_idName`` with ``_fromDatabase``. + * More databases supported. There has been interest and some work in - the progress for Oracle, Sybase, and MS-SQL support. + the progress for Oracle. IWBN to have DB2 driver. + * Better transaction support -- right now you can use transactions for the database, but the object isn't transaction-aware, so non-database persistence won't be able to be rolled back. + * Optimistic locking and other techniques to handle concurrency. + * Profile of SQLObject performance, so that I can identify bottlenecks. + * Increase hooks with FormEncode (unreleased) validation and form generation package, so SQLObject classes (read: schemas) can be - published for editing more directly and easily. + published for editing more directly and easily. (First step: get + Schema-generating method into sqlmeta class) + +* Simple method (in sqlmeta) for serializing a SQLObject instance to a + dictionary -- both a dead dictionary (copy of values) and a live + dictionary (setting keys changes the instance). + * Automatic joins in select queries. + * More kinds of joins, and more powerful join results (closer to how `select` works). + +* Refactor ``DBConnection`` to use parameterized queries instead of + generating query strings. + +* Deprecate support for Python 2.2. Start using logging instead of print + for debugging output. + +* Event system. This will effect columns; patterns like ``onUpdate`` + methods and whatnot. Probably will use PyDispatcher: + http://pydispatcher.sourceforge.net/ + +* A hierarchy of exceptions. SQLObject should translate exceptions from + low-level drivers to a consistent set of high-level exceptions. |
|
From: <sub...@co...> - 2006-05-17 18:13:42
|
Author: phd Date: 2006-05-17 12:13:35 -0600 (Wed, 17 May 2006) New Revision: 1771 Modified: SQLObject/docs/TODO.txt Log: Added DB2 and hierarchy of exceptions. Modified: SQLObject/docs/TODO.txt =================================================================== --- SQLObject/docs/TODO.txt 2006-05-17 16:08:18 UTC (rev 1770) +++ SQLObject/docs/TODO.txt 2006-05-17 18:13:35 UTC (rev 1771) @@ -6,7 +6,7 @@ ``_idName`` with ``_fromDatabase``. * More databases supported. There has been interest and some work in - the progress for Oracle and Sybase support. + the progress for Oracle. IWBN to have DB2 driver. * Better transaction support -- right now you can use transactions for the database, but the object isn't transaction-aware, so @@ -40,4 +40,5 @@ methods and whatnot. Probably will use PyDispatcher: http://pydispatcher.sourceforge.net/ - +* A hierarchy of exceptions. SQLObject should translate exceptions from + low-level drivers to a consistent set of high-level exceptions. |
|
From: <sub...@co...> - 2006-05-17 16:08:25
|
Author: phd
Date: 2006-05-17 10:08:18 -0600 (Wed, 17 May 2006)
New Revision: 1770
Modified:
SQLObject/branches/0.7-bugfix/sqlobject/cache.py
Log:
Merged a small part of the cull patch from the trunk.
Modified: SQLObject/branches/0.7-bugfix/sqlobject/cache.py
===================================================================
--- SQLObject/branches/0.7-bugfix/sqlobject/cache.py 2006-05-17 14:14:28 UTC (rev 1769)
+++ SQLObject/branches/0.7-bugfix/sqlobject/cache.py 2006-05-17 16:08:18 UTC (rev 1770)
@@ -97,7 +97,8 @@
# method has a lock, so it's threadsafe.
self.cullCount = 0
self.cull()
-
+ else:
+ self.cullCount += 1
try:
return self.cache[id]
except KeyError:
|
|
From: <sub...@co...> - 2006-05-17 14:14:35
|
Author: phd
Date: 2006-05-17 08:14:28 -0600 (Wed, 17 May 2006)
New Revision: 1769
Modified:
home/phd/SQLObject/paramstyles/sqlobject/manager/command.py
Log:
Merged patches from the revisions 1760:1768 from the trunk
Modified: home/phd/SQLObject/paramstyles/sqlobject/manager/command.py
===================================================================
--- home/phd/SQLObject/paramstyles/sqlobject/manager/command.py 2006-05-14 21:37:11 UTC (rev 1768)
+++ home/phd/SQLObject/paramstyles/sqlobject/manager/command.py 2006-05-17 14:14:28 UTC (rev 1769)
@@ -553,7 +553,13 @@
if (self.options.create_db
and soClass._connection not in dbs_created):
if not self.options.simulate:
- soClass._connection.createEmptyDatabase()
+ try:
+ soClass._connection.createEmptyDatabase()
+ except soClass._connection.module.ProgrammingError, e:
+ if str(e).find('already exists') != -1:
+ print 'Database already exists'
+ else:
+ raise
else:
print '(simulating; cannot create database)'
dbs_created.append(soClass._connection)
|
|
From: SourceForge.net <no...@so...> - 2006-05-15 18:13:35
|
Patches item #1489030, was opened at 2006-05-15 11:13 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1489030&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 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Fix relative paths for connections Initial Comment: When creating a DBConnection such as sqlite:/members.db an extra / is added to the beginning of the path. This patch moves that to the individual if statements depending on whether it is a relative, absolute or other type of path. It's a simple fix, probably could be tidied up to not repeat itself but this works and it makes sqlite happy. Cheers, ~andy -- Andy Kilner <an...@an...> ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1489030&group_id=74338 |