sqlobject-cvs Mailing List for SQLObject (Page 82)
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
(9) |
Apr
(74) |
May
(29) |
Jun
(16) |
Jul
(28) |
Aug
(10) |
Sep
(57) |
Oct
(9) |
Nov
(29) |
Dec
(12) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(7) |
Feb
(14) |
Mar
(6) |
Apr
(3) |
May
(12) |
Jun
(34) |
Jul
(9) |
Aug
(29) |
Sep
(22) |
Oct
(2) |
Nov
(15) |
Dec
(52) |
| 2005 |
Jan
(47) |
Feb
(78) |
Mar
(14) |
Apr
(35) |
May
(33) |
Jun
(16) |
Jul
(26) |
Aug
(63) |
Sep
(40) |
Oct
(96) |
Nov
(96) |
Dec
(123) |
| 2006 |
Jan
(159) |
Feb
(144) |
Mar
(64) |
Apr
(31) |
May
(88) |
Jun
(48) |
Jul
(16) |
Aug
(64) |
Sep
(87) |
Oct
(92) |
Nov
(56) |
Dec
(76) |
| 2007 |
Jan
(94) |
Feb
(103) |
Mar
(126) |
Apr
(123) |
May
(85) |
Jun
(11) |
Jul
(130) |
Aug
(47) |
Sep
(65) |
Oct
(70) |
Nov
(12) |
Dec
(11) |
| 2008 |
Jan
(30) |
Feb
(55) |
Mar
(88) |
Apr
(20) |
May
(50) |
Jun
|
Jul
(38) |
Aug
(1) |
Sep
(9) |
Oct
(5) |
Nov
(6) |
Dec
(39) |
| 2009 |
Jan
(8) |
Feb
(16) |
Mar
(3) |
Apr
(33) |
May
(44) |
Jun
(1) |
Jul
(10) |
Aug
(33) |
Sep
(74) |
Oct
(22) |
Nov
|
Dec
(15) |
| 2010 |
Jan
(28) |
Feb
(22) |
Mar
(46) |
Apr
(29) |
May
(1) |
Jun
(1) |
Jul
(27) |
Aug
(8) |
Sep
(5) |
Oct
(33) |
Nov
(24) |
Dec
(41) |
| 2011 |
Jan
(4) |
Feb
(12) |
Mar
(35) |
Apr
(29) |
May
(19) |
Jun
(16) |
Jul
(32) |
Aug
(25) |
Sep
(5) |
Oct
(11) |
Nov
(21) |
Dec
(12) |
| 2012 |
Jan
(3) |
Feb
(4) |
Mar
(20) |
Apr
(4) |
May
(25) |
Jun
(13) |
Jul
|
Aug
|
Sep
(2) |
Oct
(25) |
Nov
(9) |
Dec
(1) |
| 2013 |
Jan
(6) |
Feb
(8) |
Mar
|
Apr
(10) |
May
(31) |
Jun
(7) |
Jul
(18) |
Aug
(33) |
Sep
(4) |
Oct
(16) |
Nov
|
Dec
(27) |
| 2014 |
Jan
(2) |
Feb
|
Mar
|
Apr
(11) |
May
(39) |
Jun
(8) |
Jul
(11) |
Aug
(4) |
Sep
|
Oct
(27) |
Nov
|
Dec
(71) |
| 2015 |
Jan
(17) |
Feb
(47) |
Mar
(33) |
Apr
|
May
|
Jun
(9) |
Jul
(7) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(8) |
| 2016 |
Jan
(4) |
Feb
(4) |
Mar
|
Apr
|
May
(12) |
Jun
(7) |
Jul
(9) |
Aug
(31) |
Sep
(8) |
Oct
(3) |
Nov
(15) |
Dec
(1) |
| 2017 |
Jan
(13) |
Feb
(7) |
Mar
(14) |
Apr
(8) |
May
(10) |
Jun
(4) |
Jul
(2) |
Aug
(1) |
Sep
|
Oct
(8) |
Nov
(4) |
Dec
(5) |
| 2018 |
Jan
(2) |
Feb
(8) |
Mar
|
Apr
(4) |
May
|
Jun
(6) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2019 |
Jan
(1) |
Feb
(16) |
Mar
(1) |
Apr
(3) |
May
(5) |
Jun
(1) |
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
(1) |
Dec
(3) |
| 2020 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(1) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
(2) |
Nov
|
Dec
(2) |
| 2021 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(1) |
Dec
|
| 2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(6) |
Oct
(1) |
Nov
(1) |
Dec
(4) |
| 2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(3) |
Sep
(2) |
Oct
(2) |
Nov
(4) |
Dec
|
| 2024 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(9) |
| 2025 |
Jan
|
Feb
(4) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
(2) |
Dec
(2) |
|
From: <sub...@co...> - 2007-09-10 13:20:56
|
Author: phd
Date: 2007-09-10 07:20:51 -0600 (Mon, 10 Sep 2007)
New Revision: 2907
Modified:
SQLObject/trunk/sqlobject/col.py
Log:
No need to test for OverflowError - in Python 2.3+ int() automatically returns a long
in case of an overflow.
Modified: SQLObject/trunk/sqlobject/col.py
===================================================================
--- SQLObject/trunk/sqlobject/col.py 2007-09-10 04:15:02 UTC (rev 2906)
+++ SQLObject/trunk/sqlobject/col.py 2007-09-10 13:20:51 UTC (rev 2907)
@@ -569,10 +569,7 @@
if isinstance(value, (int, long, sqlbuilder.SQLExpression)):
return value
try:
- try:
- return int(value)
- except OverflowError: # for Python 2.2
- return long(value)
+ return int(value)
except:
raise validators.Invalid("expected an int in the IntCol '%s', got %s %r instead" % \
(self.name, type(value), value), value, state)
|
|
From: SourceForge.net <no...@so...> - 2007-09-10 08:43:17
|
Bugs item #1768433, was opened at 2007-08-06 14:01 Message generated for change (Comment added) made by azav You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1768433&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: SQLObject release (specify) Status: Open Resolution: None Priority: 5 Private: No Submitted By: azav (azav) Assigned to: Nobody/Anonymous (nobody) Summary: Versioning broken in 0.9.1 Initial Comment: The versions table uses the same constraints as the original table, so having for instance a unique column in a table will raise a DuplicateEntryError when a second version with the same name is created. ---------------------------------------------------------------------- >Comment By: azav (azav) Date: 2007-09-10 08:43 Message: Logged In: YES user_id=1861531 Originator: YES This only fixes part of the problem. For instance, version tables will still be created with the foreign key constraints of the original table. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2007-09-07 20:37 Message: Logged In: NO I stumbled across the same problem. As constraints are directly copied to version tables, each version of a row needs to hold new values in all unique columns. This may not be acceptable to all applications. In order to fix this a minor change can be made to the file /sqlobject/versioning/__init__.py. You merely need to add a few lines. Heres the result from a diff between the original and my changed version: 48c48,51 < columns[column] = defi.__class__(**defi._kw) --- > kwds = dict(defi._kw) > for kw in ["alternateID", "unique"]: > if kw in kwds: del kwds[kw] > columns[column] = defi.__class__(**kwds) I dont know if this is the way the sqlobject authors would do it, but it seems to work. Hopefully it will result in a faster patch :-) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1768433&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2007-09-07 20:37:19
|
Bugs item #1768433, was opened at 2007-08-06 07:01 Message generated for change (Comment added) made by nobody You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1768433&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: SQLObject release (specify) Status: Open Resolution: None Priority: 5 Private: No Submitted By: azav (azav) Assigned to: Nobody/Anonymous (nobody) Summary: Versioning broken in 0.9.1 Initial Comment: The versions table uses the same constraints as the original table, so having for instance a unique column in a table will raise a DuplicateEntryError when a second version with the same name is created. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2007-09-07 13:37 Message: Logged In: NO I stumbled across the same problem. As constraints are directly copied to version tables, each version of a row needs to hold new values in all unique columns. This may not be acceptable to all applications. In order to fix this a minor change can be made to the file /sqlobject/versioning/__init__.py. You merely need to add a few lines. Heres the result from a diff between the original and my changed version: 48c48,51 < columns[column] = defi.__class__(**defi._kw) --- > kwds = dict(defi._kw) > for kw in ["alternateID", "unique"]: > if kw in kwds: del kwds[kw] > columns[column] = defi.__class__(**kwds) I dont know if this is the way the sqlobject authors would do it, but it seems to work. Hopefully it will result in a faster patch :-) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1768433&group_id=74338 |
|
From: <sub...@co...> - 2007-09-07 13:46:56
|
Author: phd
Date: 2007-09-07 07:46:47 -0600 (Fri, 07 Sep 2007)
New Revision: 2904
Modified:
SQLObject/trunk/sqlobject/col.py
SQLObject/trunk/sqlobject/converters.py
SQLObject/trunk/sqlobject/tests/test_auto.py
SQLObject/trunk/sqlobject/tests/test_auto_old.py
SQLObject/trunk/sqlobject/tests/test_datetime.py
SQLObject/trunk/sqlobject/versioning/test/test_version.py
Log:
datetime is always available in Python 2.3+, no need to test it.
Modified: SQLObject/trunk/sqlobject/col.py
===================================================================
--- SQLObject/trunk/sqlobject/col.py 2007-09-07 13:24:48 UTC (rev 2903)
+++ SQLObject/trunk/sqlobject/col.py 2007-09-07 13:46:47 UTC (rev 2904)
@@ -36,12 +36,8 @@
NoDefault = sqlbuilder.NoDefault
True, False = 1==1, 0==1
-try:
- import datetime
-except ImportError: # Python 2.2
- datetime_available = False
-else:
- datetime_available = True
+import datetime
+datetime_available = True
try:
from mx import DateTime
@@ -66,18 +62,11 @@
DateTimeType = type(DateTime.DateTime())
TimeType = type(DateTime.DateTime.Time(DateTime.DateTime()))
-if datetime_available:
- default_datetime_implementation = DATETIME_IMPLEMENTATION
-elif mxdatetime_available:
- default_datetime_implementation = MXDATETIME_IMPLEMENTATION
-else:
- default_datetime_implementation = None
+default_datetime_implementation = DATETIME_IMPLEMENTATION
__all__ = ["datetime_available", "mxdatetime_available",
- "default_datetime_implementation"
-]
-if datetime_available:
- __all__.append("DATETIME_IMPLEMENTATION")
+ "default_datetime_implementation", "DATETIME_IMPLEMENTATION"]
+
if mxdatetime_available:
__all__.append("MXDATETIME_IMPLEMENTATION")
@@ -1031,43 +1020,42 @@
baseClass = SOSetCol
-if datetime_available:
- class DateTimeValidator(validators.DateValidator):
- def to_python(self, value, state):
- if value is None:
- return None
- if isinstance(value, (datetime.datetime, datetime.date, datetime.time, sqlbuilder.SQLExpression)):
- return value
- if mxdatetime_available:
- if isinstance(value, DateTimeType):
- # convert mxDateTime instance to datetime
- if (self.format.find("%H") >= 0) or (self.format.find("%T")) >= 0:
- return datetime.datetime(value.year, value.month, value.day,
- value.hour, value.minute, int(value.second))
- else:
- return datetime.date(value.year, value.month, value.day)
- elif isinstance(value, TimeType):
- # convert mxTime instance to time
- if self.format.find("%d") >= 0:
- return datetime.timedelta(seconds=value.seconds)
- else:
- return datetime.time(value.hour, value.minute, int(value.second))
- try:
- stime = time.strptime(value, self.format)
- except:
- raise validators.Invalid("expected a date/time string of the '%s' format in the DateTimeCol '%s', got %s %r instead" % \
- (self.format, self.name, type(value), value), value, state)
- return datetime.datetime(*stime[:6])
+class DateTimeValidator(validators.DateValidator):
+ def to_python(self, value, state):
+ if value is None:
+ return None
+ if isinstance(value, (datetime.datetime, datetime.date, datetime.time, sqlbuilder.SQLExpression)):
+ return value
+ if mxdatetime_available:
+ if isinstance(value, DateTimeType):
+ # convert mxDateTime instance to datetime
+ if (self.format.find("%H") >= 0) or (self.format.find("%T")) >= 0:
+ return datetime.datetime(value.year, value.month, value.day,
+ value.hour, value.minute, int(value.second))
+ else:
+ return datetime.date(value.year, value.month, value.day)
+ elif isinstance(value, TimeType):
+ # convert mxTime instance to time
+ if self.format.find("%d") >= 0:
+ return datetime.timedelta(seconds=value.seconds)
+ else:
+ return datetime.time(value.hour, value.minute, int(value.second))
+ try:
+ stime = time.strptime(value, self.format)
+ except:
+ raise validators.Invalid("expected a date/time string of the '%s' format in the DateTimeCol '%s', got %s %r instead" % \
+ (self.format, self.name, type(value), value), value, state)
+ return datetime.datetime(*stime[:6])
- def from_python(self, value, state):
- if value is None:
- return None
- if isinstance(value, (datetime.datetime, datetime.date, datetime.time, sqlbuilder.SQLExpression)):
- return value
- if hasattr(value, "strftime"):
- return value.strftime(self.format)
- raise validators.Invalid("expected a datetime in the DateTimeCol '%s', got %s %r instead" % \
- (self.name, type(value), value), value, state)
+ def from_python(self, value, state):
+ if value is None:
+ return None
+ if isinstance(value, (datetime.datetime, datetime.date, datetime.time, sqlbuilder.SQLExpression)):
+ return value
+ if hasattr(value, "strftime"):
+ return value.strftime(self.format)
+ raise validators.Invalid("expected a datetime in the DateTimeCol '%s', got %s %r instead" % \
+ (self.name, type(value), value), value, state)
if mxdatetime_available:
class MXDateTimeValidator(validators.DateValidator):
@@ -1076,14 +1064,13 @@
return None
if isinstance(value, (DateTimeType, TimeType, sqlbuilder.SQLExpression)):
return value
- if datetime_available: # convert datetime instance to mxDateTime
- if isinstance(value, datetime.datetime):
- return DateTime.DateTime(value.year, value.month, value.day,
- value.hour, value.minute, value.second)
- elif isinstance(value, datetime.date):
- return DateTime.Date(value.year, value.month, value.day)
- elif isinstance(value, datetime.time):
- return DateTime.Time(value.hour, value.minute, value.second)
+ if isinstance(value, datetime.datetime):
+ return DateTime.DateTime(value.year, value.month, value.day,
+ value.hour, value.minute, value.second)
+ elif isinstance(value, datetime.date):
+ return DateTime.Date(value.year, value.month, value.day)
+ elif isinstance(value, datetime.time):
+ return DateTime.Time(value.hour, value.minute, value.second)
try:
stime = time.strptime(value, self.format)
except:
@@ -1154,19 +1141,19 @@
% DATETIME_IMPLEMENTATION)
now = staticmethod(now)
-if datetime_available:
- class DateValidator(DateTimeValidator):
- def to_python(self, value, state):
- if isinstance(value, datetime.datetime):
- value = value.date()
- if isinstance(value, datetime.date):
- return value
- value = super(DateValidator, self).to_python(value, state)
- if isinstance(value, datetime.datetime):
- value = value.date()
+
+class DateValidator(DateTimeValidator):
+ def to_python(self, value, state):
+ if isinstance(value, datetime.datetime):
+ value = value.date()
+ if isinstance(value, datetime.date):
return value
+ value = super(DateValidator, self).to_python(value, state)
+ if isinstance(value, datetime.datetime):
+ value = value.date()
+ return value
- from_python = to_python
+ from_python = to_python
class SODateCol(SOCol):
dateFormat = '%Y-%m-%d'
@@ -1215,21 +1202,20 @@
baseClass = SODateCol
-if datetime_available:
- class TimeValidator(DateTimeValidator):
- def to_python(self, value, state):
- if isinstance(value, datetime.time):
- return value
- if isinstance(value, datetime.timedelta):
- if value.days:
- raise validators.Invalid(
- "the value for the TimeCol '%s' must has days=0, it has days=%d" %
- (self.name, value.days), value, state)
- return datetime.time(*time.gmtime(value.seconds)[3:6])
- value = super(TimeValidator, self).to_python(value, state)
- if isinstance(value, datetime.datetime):
- value = value.time()
+class TimeValidator(DateTimeValidator):
+ def to_python(self, value, state):
+ if isinstance(value, datetime.time):
return value
+ if isinstance(value, datetime.timedelta):
+ if value.days:
+ raise validators.Invalid(
+ "the value for the TimeCol '%s' must has days=0, it has days=%d" %
+ (self.name, value.days), value, state)
+ return datetime.time(*time.gmtime(value.seconds)[3:6])
+ value = super(TimeValidator, self).to_python(value, state)
+ if isinstance(value, datetime.datetime):
+ value = value.time()
+ return value
class SOTimeCol(SOCol):
timeFormat = '%H:%M:%S'
Modified: SQLObject/trunk/sqlobject/converters.py
===================================================================
--- SQLObject/trunk/sqlobject/converters.py 2007-09-07 13:24:48 UTC (rev 2903)
+++ SQLObject/trunk/sqlobject/converters.py 2007-09-07 13:46:47 UTC (rev 2904)
@@ -15,10 +15,7 @@
DateTimeDeltaType = None
import time
-try:
- import datetime
-except ImportError:
- datetime = None
+import datetime
try:
import Sybase
@@ -202,23 +199,22 @@
registerConverter(time.struct_time, StructTimeConverter)
-if datetime:
- def DateTimeConverter(value, db):
- return "'%04d-%02d-%02d %02d:%02d:%02d'" % (
- value.year, value.month, value.day,
- value.hour, value.minute, value.second)
+def DateTimeConverter(value, db):
+ return "'%04d-%02d-%02d %02d:%02d:%02d'" % (
+ value.year, value.month, value.day,
+ value.hour, value.minute, value.second)
- registerConverter(datetime.datetime, DateTimeConverter)
+registerConverter(datetime.datetime, DateTimeConverter)
- def DateConverter(value, db):
- return "'%04d-%02d-%02d'" % (value.year, value.month, value.day)
+def DateConverter(value, db):
+ return "'%04d-%02d-%02d'" % (value.year, value.month, value.day)
- registerConverter(datetime.date, DateConverter)
+registerConverter(datetime.date, DateConverter)
- def TimeConverter(value, db):
- return "'%02d:%02d:%02d'" % (value.hour, value.minute, value.second)
+def TimeConverter(value, db):
+ return "'%02d:%02d:%02d'" % (value.hour, value.minute, value.second)
- registerConverter(datetime.time, TimeConverter)
+registerConverter(datetime.time, TimeConverter)
if Decimal:
def DecimalConverter(value, db):
Modified: SQLObject/trunk/sqlobject/tests/test_auto.py
===================================================================
--- SQLObject/trunk/sqlobject/tests/test_auto.py 2007-09-07 13:24:48 UTC (rev 2903)
+++ SQLObject/trunk/sqlobject/tests/test_auto.py 2007-09-07 13:46:47 UTC (rev 2904)
@@ -1,3 +1,6 @@
+from datetime import datetime
+now = datetime.now
+
from sqlobject import *
from sqlobject.tests.dbtest import *
from sqlobject import classregistry
@@ -3,10 +6,4 @@
from py.test import raises
-try:
- from datetime import datetime
- now = datetime.now
-except ImportError:
- from mx.DateTime import now
-
########################################
## Dynamic column tests
Modified: SQLObject/trunk/sqlobject/tests/test_auto_old.py
===================================================================
--- SQLObject/trunk/sqlobject/tests/test_auto_old.py 2007-09-07 13:24:48 UTC (rev 2903)
+++ SQLObject/trunk/sqlobject/tests/test_auto_old.py 2007-09-07 13:46:47 UTC (rev 2904)
@@ -1,11 +1,9 @@
+from datetime import datetime
+now = datetime.now
+
from sqlobject import *
from sqlobject.tests.dbtest import *
from sqlobject import classregistry
-try:
- from datetime import datetime
- now = datetime.now
-except ImportError:
- from mx.DateTime import now
########################################
## Auto class generation
Modified: SQLObject/trunk/sqlobject/tests/test_datetime.py
===================================================================
--- SQLObject/trunk/sqlobject/tests/test_datetime.py 2007-09-07 13:24:48 UTC (rev 2903)
+++ SQLObject/trunk/sqlobject/tests/test_datetime.py 2007-09-07 13:46:47 UTC (rev 2904)
@@ -1,43 +1,42 @@
from sqlobject import *
from sqlobject.tests.dbtest import *
-from sqlobject import col
########################################
## Date/time columns
########################################
-if datetime_available:
- col.default_datetime_implementation = DATETIME_IMPLEMENTATION
- from datetime import datetime, date, time
+from sqlobject import col
+col.default_datetime_implementation = DATETIME_IMPLEMENTATION
+from datetime import datetime, date, time
- class DateTime1(SQLObject):
- col1 = DateTimeCol()
- col2 = DateCol()
- col3 = TimeCol()
+class DateTime1(SQLObject):
+ col1 = DateTimeCol()
+ col2 = DateCol()
+ col3 = TimeCol()
- def test_dateTime():
- setupClass(DateTime1)
- _now = datetime.now()
- dt1 = DateTime1(col1=_now, col2=_now, col3=_now.time())
+def test_dateTime():
+ setupClass(DateTime1)
+ _now = datetime.now()
+ dt1 = DateTime1(col1=_now, col2=_now, col3=_now.time())
- assert isinstance(dt1.col1, datetime)
- assert dt1.col1.year == _now.year
- assert dt1.col1.month == _now.month
- assert dt1.col1.day == _now.day
- assert dt1.col1.hour == _now.hour
- assert dt1.col1.minute == _now.minute
- assert dt1.col1.second == int(_now.second)
+ assert isinstance(dt1.col1, datetime)
+ assert dt1.col1.year == _now.year
+ assert dt1.col1.month == _now.month
+ assert dt1.col1.day == _now.day
+ assert dt1.col1.hour == _now.hour
+ assert dt1.col1.minute == _now.minute
+ assert dt1.col1.second == int(_now.second)
- assert isinstance(dt1.col2, date)
- assert not isinstance(dt1.col2, datetime)
- assert dt1.col2.year == _now.year
- assert dt1.col2.month == _now.month
- assert dt1.col2.day == _now.day
+ assert isinstance(dt1.col2, date)
+ assert not isinstance(dt1.col2, datetime)
+ assert dt1.col2.year == _now.year
+ assert dt1.col2.month == _now.month
+ assert dt1.col2.day == _now.day
- assert isinstance(dt1.col3, time)
- assert dt1.col3.hour == _now.hour
- assert dt1.col3.minute == _now.minute
- assert dt1.col3.second == int(_now.second)
+ assert isinstance(dt1.col3, time)
+ assert dt1.col3.hour == _now.hour
+ assert dt1.col3.minute == _now.minute
+ assert dt1.col3.second == int(_now.second)
if mxdatetime_available:
col.default_datetime_implementation = MXDATETIME_IMPLEMENTATION
Modified: SQLObject/trunk/sqlobject/versioning/test/test_version.py
===================================================================
--- SQLObject/trunk/sqlobject/versioning/test/test_version.py 2007-09-07 13:24:48 UTC (rev 2903)
+++ SQLObject/trunk/sqlobject/versioning/test/test_version.py 2007-09-07 13:46:47 UTC (rev 2904)
@@ -9,9 +9,7 @@
from sqlobject.versioning import Versioning
from sqlobject.tests.dbtest import *
-from datetime import datetime
-
class MyClass(SQLObject):
name = StringCol()
versions = Versioning()
|
|
From: <sub...@co...> - 2007-09-07 13:25:17
|
Author: phd Date: 2007-09-07 07:24:48 -0600 (Fri, 07 Sep 2007) New Revision: 2903 Modified: SQLObject/docs/News.txt SQLObject/docs/SQLObject.txt Log: Going to drop support for Python 2.2. Modified: SQLObject/docs/News.txt =================================================================== --- SQLObject/docs/News.txt 2007-09-06 03:11:42 UTC (rev 2902) +++ SQLObject/docs/News.txt 2007-09-07 13:24:48 UTC (rev 2903) @@ -13,12 +13,15 @@ Features & Interface -------------------- +* Dropped support for Python 2.2. The minimal version of Python for + SQLObject is 2.3 now. + * SQLBuilder Select supports the rest of SelectResults options (reversed, distinct, joins, etc.) * SQLObject.select() (i.e., SelectResults) and DBConnection.queryForSelect() - use SQLBuilder Select queries; this make all SELECTs implemented via - single API. + use SQLBuilder Select queries; this make all SELECTs implemented + internally via a single mechanism. * SQLBuilder Joins handle SQLExpression tables (not just str/SQLObject/Alias) and properly sqlrepr. @@ -42,7 +45,7 @@ * Added ViewSQLObject. * Added sqlmeta.getColumns() to get all the columns for a class (including - parent classes), excluding the column 'childName' indncluding the column + parent classes), excluding the column 'childName' and including the column 'id'. sqlmeta.asDict() now uses getColumns(), so there is no need to override it in the inheritable sqlmeta class; this makes asDict() to work properly on inheritable sqlobjects. Modified: SQLObject/docs/SQLObject.txt =================================================================== --- SQLObject/docs/SQLObject.txt 2007-09-06 03:11:42 UTC (rev 2902) +++ SQLObject/docs/SQLObject.txt 2007-09-07 13:24:48 UTC (rev 2903) @@ -66,7 +66,7 @@ .. _FreeTDS: http://www.freetds.org/ .. _ADODBAPI: http://adodbapi.sourceforge.net/ -Python 2.2 or higher is required. SQLObject makes extensive use of +Python 2.3 or higher is required. SQLObject makes extensive use of new-style classes. Compared To Other Database Wrappers @@ -283,7 +283,7 @@ True Columns are accessed like attributes. (This uses the ``property`` -feature of Python 2.2, so that retrieving and setting these attributes +feature of Python, so that retrieving and setting these attributes executes code). Also note that objects are unique -- there is generally only one ``Person`` instance of a particular id in memory at any one time. If you ask for a person by a particular ID more than @@ -1659,12 +1659,10 @@ You can additionally pass `logger` keyword argument which should be a name of the logger to use. If specified and `debug` is ``True``, SQLObject will write debug print statements via that logger instead of printing directly -to console. Note that this options requires logging module which is -available starting from Python 2.3. The argument `loglevel` allows to -choose the logging level - it can be "debug", "info", "warning", "error", -"critical" or "exception". In case `logger` is empty or absent SQLObject -uses prints instead of logging; `loglevel` can be "stdout" or "stderr" in -this case; default is "stdout". +to console. The argument `loglevel` allows to choose the logging level - it +can be "debug", "info", "warning", "error", "critical" or "exception". In +case `logger` is empty or absent SQLObject uses prints instead of logging; +`loglevel` can be "stdout" or "stderr" in this case; default is "stdout". To configure logging one can do something like that:: |
|
From: SourceForge.net <no...@so...> - 2007-09-07 13:15:12
|
Bugs item #1764739, was opened at 2007-07-31 19:27 Message generated for change (Comment added) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1764739&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: None >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Johan Carlsson (johanc) >Assigned to: Oleg Broytmann (phd) Summary: Buggs in Select Initial Comment: This is for: sqlobject-0.10dev_r2829-py2.4.egg I've found some things that doesn't work in the sqlbuilder.Select class. In the __sqlrepr__ method ops['limit'] isn't used correctly: def __sqlrepr__: ... if self.ops['limit'] is not NoDefault: end = start + limit Now it seem like when using slices ops['limit'] can be None (not NoDefault). Also as can be noted limit is never set, I supposed it to be self.ops['limit']. Resulting in: NameError: global name 'limit' is not defined Select(..., limit=2) does give (not sure why, I might be me): OperationalError: near "<": syntax error ---------------------------------------------------------------------- >Comment By: Oleg Broytmann (phd) Date: 2007-09-07 17:15 Message: Logged In: YES user_id=4799 Originator: NO I think it's been fixed in the revision 2893. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1764739&group_id=74338 |
|
From: Marilyn P. <lx...@bl...> - 2007-09-07 07:33:01
|
Greetings. I search for the person {the man} with serious intention. I would like to learn you better, and flight, that you love me also. I shall write more detailed information to you then in the letter. If you are interested in it, you can write to me electronic: jul...@ra...
Here you as can look my photo: http://picasaweb.google.com/CoolJyliya/PhotoJuliya> I shall be very glad to receive from you the answer. With my best regards, Yuliya.
|
|
From: <caw...@ms...> - 2007-09-06 13:39:51
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <body> Do you trade files online? Then they will come after you. Search the news for RIAA and see what they are doing to people like you. They can't trace you if you use Tor. Use our free program and keep your self and the internet free and safe. <a href="http://68.47.83.162/">Download Tor</a> </body> </html> |
|
From: <dbi...@kt...> - 2007-09-05 10:01:26
|
Investors Go Crazy For VGPM As News Hits Tuesday. VEGA PROMOTIONAL SYSTEMS, INC VGPM $0.077 Pokers number one player is now the number one teacher online. Members are already hot for the amazing new site. Learn the ins and outs of online poker from the most famous player in the game. This week VGPM is hosting the World Series of Poker to promote the new site. VGPM is the next hot technology gaming group. What ever you do, don't forget to grab VGPM first thing Wednesday. |
|
From: <viv...@ci...> - 2007-09-03 12:21:42
|
VGPM hits market like a storm. VEGA PROMOTIONAL SYS, INC VGPM $0.07 Online multiplayer gaming is over Billion dollar industry. One online game pulled in over 471 Million in 2006 Watch VGPM grab a lion's share of that market with a whole new line-up of subscriber games. Read up and get on VPGM first thing Tuesday. |
|
From: <mat...@ma...> - 2007-09-01 02:57:44
|
VGPM begins brewing for huge returns. Vega Promotional Sys, Inc V G P M $0.07 Subscription gaming becomes billion dollar industry. 471 Million From Word of Warcraft in 2006 got investors really excited. Watch VGPM grab a lion's share of that market with a whole new line-up of subscriber games. Get on VGPM Tuesday morning. |
|
From: <sub...@co...> - 2007-08-30 14:33:26
|
Author: phd Date: 2007-08-30 08:33:21 -0600 (Thu, 30 Aug 2007) New Revision: 2894 Modified: SQLObject/docs/News.txt Log: Remove 'limit' from SelectResults after setting start/end so .clone() never see limit again. Modified: SQLObject/docs/News.txt =================================================================== --- SQLObject/docs/News.txt 2007-08-30 14:33:02 UTC (rev 2893) +++ SQLObject/docs/News.txt 2007-08-30 14:33:21 UTC (rev 2894) @@ -50,6 +50,8 @@ SQLObject 0.9.2 =============== +* A number of changes ported from `SQLObject 0.7.9`_. + SQLObject 0.9.1 =============== @@ -292,6 +294,12 @@ SQLObject 0.7.9 =============== +Bug Fixes +--------- + +* Remove 'limit' from SelectResults after setting start/end so .clone() + never see limit again. + Other Changes ------------- |
|
From: <sub...@co...> - 2007-08-30 14:33:08
|
Author: phd
Date: 2007-08-30 08:33:02 -0600 (Thu, 30 Aug 2007)
New Revision: 2893
Modified:
SQLObject/trunk/sqlobject/sresults.py
SQLObject/trunk/sqlobject/tests/test_select.py
Log:
Remove 'limit' from SelectResults after setting start/end so .clone() never see limit again.
Modified: SQLObject/trunk/sqlobject/sresults.py
===================================================================
--- SQLObject/trunk/sqlobject/sresults.py 2007-08-30 14:32:38 UTC (rev 2892)
+++ SQLObject/trunk/sqlobject/sresults.py 2007-08-30 14:33:02 UTC (rev 2893)
@@ -31,7 +31,7 @@
assert not ops.get('start', None) and not ops.get('end', None), \
"'limit' cannot be used with 'start' or 'end'"
ops["start"] = 0
- ops["end"] = ops["limit"]
+ ops["end"] = ops.pop("limit")
tablesDict = sqlbuilder.tablesUsedDict(self.clause, self._getConnection().dbName)
if clauseTables:
@@ -170,13 +170,13 @@
if self.ops.get('end', None) is not None \
and self.ops['end'] < end:
end = self.ops['end']
- return self.clone(limit=None, start=start, end=end)
+ return self.clone(start=start, end=end)
else:
if value < 0:
return list(iter(self))[value]
else:
start = self.ops.get('start', 0) + value
- return list(self.clone(limit=None, start=start, end=start+1))[0]
+ return list(self.clone(start=start, end=start+1))[0]
def __iter__(self):
# @@: This could be optimized, using a simpler algorithm
@@ -208,10 +208,11 @@
def count(self):
""" Counting elements of current select results """
- assert not self.ops.get('limit'), "'limit' is meaningless with 'distinct'"
+ assert not self.ops.get('start') and not self.ops.get('end'), \
+ "start/end/limit have no meaning with 'count'"
assert not (self.ops.get('distinct') and (self.ops.get('start')
or self.ops.get('end'))), \
- "distinct-counting of sliced objects is not supported"
+ "distinct-counting of sliced objects is not supported"
if self.ops.get('distinct'):
# Column must be specified, so we are using unique ID column.
# COUNT(DISTINCT column) is supported by MySQL and PostgreSQL,
Modified: SQLObject/trunk/sqlobject/tests/test_select.py
===================================================================
--- SQLObject/trunk/sqlobject/tests/test_select.py 2007-08-30 14:32:38 UTC (rev 2892)
+++ SQLObject/trunk/sqlobject/tests/test_select.py 2007-08-30 14:33:02 UTC (rev 2893)
@@ -77,8 +77,7 @@
def test_05_select_limit():
setupIter()
assert len(list(IterTest.select(limit=2))) == 2
- raises(AssertionError, IterTest.select(limit=2).distinct)
- raises(AssertionError, IterTest.select(limit=2).clone, start=1)
+ raises(AssertionError, IterTest.select(limit=2).count)
def test_06_like():
setupIter()
|
|
From: <sub...@co...> - 2007-08-30 14:32:58
|
Author: phd
Date: 2007-08-30 08:32:38 -0600 (Thu, 30 Aug 2007)
New Revision: 2892
Modified:
SQLObject/branches/0.9/docs/News.txt
SQLObject/branches/0.9/sqlobject/sresults.py
SQLObject/branches/0.9/sqlobject/tests/test_select.py
Log:
Remove 'limit' from SelectResults after setting start/end so .clone() never see limit again.
Modified: SQLObject/branches/0.9/docs/News.txt
===================================================================
--- SQLObject/branches/0.9/docs/News.txt 2007-08-30 14:30:52 UTC (rev 2891)
+++ SQLObject/branches/0.9/docs/News.txt 2007-08-30 14:32:38 UTC (rev 2892)
@@ -10,6 +10,8 @@
SQLObject 0.9.2
===============
+* A number of changes ported from `SQLObject 0.7.9`_.
+
SQLObject 0.9.1
===============
@@ -258,6 +260,12 @@
SQLObject 0.7.9
===============
+Bug Fixes
+---------
+
+* Remove 'limit' from SelectResults after setting start/end so .clone()
+ never see limit again.
+
Other Changes
-------------
Modified: SQLObject/branches/0.9/sqlobject/sresults.py
===================================================================
--- SQLObject/branches/0.9/sqlobject/sresults.py 2007-08-30 14:30:52 UTC (rev 2891)
+++ SQLObject/branches/0.9/sqlobject/sresults.py 2007-08-30 14:32:38 UTC (rev 2892)
@@ -36,6 +36,7 @@
"'limit' cannot be used with 'start' or 'end'"
ops["start"] = 0
ops["end"] = ops["limit"]
+ del ops["limit"]
def __repr__(self):
return "<%s at %x>" % (self.__class__.__name__, id(self))
@@ -150,13 +151,13 @@
if self.ops.get('end', None) is not None \
and self.ops['end'] < end:
end = self.ops['end']
- return self.clone(limit=None, start=start, end=end)
+ return self.clone(start=start, end=end)
else:
if value < 0:
return list(iter(self))[value]
else:
start = self.ops.get('start', 0) + value
- return list(self.clone(limit=None, start=start, end=start+1))[0]
+ return list(self.clone(start=start, end=start+1))[0]
def __iter__(self):
# @@: This could be optimized, using a simpler algorithm
@@ -183,10 +184,11 @@
def count(self):
""" Counting elements of current select results """
- assert not self.ops.get('limit'), "'limit' is meaningless with 'distinct'"
+ assert not self.ops.get('start') and not self.ops.get('end'), \
+ "start/end/limit have no meaning with 'count'"
assert not (self.ops.get('distinct') and (self.ops.get('start')
or self.ops.get('end'))), \
- "distinct-counting of sliced objects is not supported"
+ "distinct-counting of sliced objects is not supported"
if self.ops.get('distinct'):
# Column must be specified, so we are using unique ID column.
# COUNT(DISTINCT column) is supported by MySQL and PostgreSQL,
Modified: SQLObject/branches/0.9/sqlobject/tests/test_select.py
===================================================================
--- SQLObject/branches/0.9/sqlobject/tests/test_select.py 2007-08-30 14:30:52 UTC (rev 2891)
+++ SQLObject/branches/0.9/sqlobject/tests/test_select.py 2007-08-30 14:32:38 UTC (rev 2892)
@@ -77,8 +77,7 @@
def test_05_select_limit():
setupIter()
assert len(list(IterTest.select(limit=2))) == 2
- raises(AssertionError, IterTest.select(limit=2).distinct)
- raises(AssertionError, IterTest.select(limit=2).clone, start=1)
+ raises(AssertionError, IterTest.select(limit=2).count)
def test_06_like():
setupIter()
|
|
From: <sub...@co...> - 2007-08-30 14:30:56
|
Author: phd
Date: 2007-08-30 08:30:52 -0600 (Thu, 30 Aug 2007)
New Revision: 2891
Modified:
SQLObject/branches/0.8/docs/News.txt
SQLObject/branches/0.8/sqlobject/sresults.py
SQLObject/branches/0.8/sqlobject/tests/test_select.py
Log:
Remove 'limit' from SelectResults after setting start/end so .clone() never see limit again.
Modified: SQLObject/branches/0.8/docs/News.txt
===================================================================
--- SQLObject/branches/0.8/docs/News.txt 2007-08-30 14:30:36 UTC (rev 2890)
+++ SQLObject/branches/0.8/docs/News.txt 2007-08-30 14:30:52 UTC (rev 2891)
@@ -186,6 +186,12 @@
SQLObject 0.7.9
===============
+Bug Fixes
+---------
+
+* Remove 'limit' from SelectResults after setting start/end so .clone()
+ never see limit again.
+
Other Changes
-------------
Modified: SQLObject/branches/0.8/sqlobject/sresults.py
===================================================================
--- SQLObject/branches/0.8/sqlobject/sresults.py 2007-08-30 14:30:36 UTC (rev 2890)
+++ SQLObject/branches/0.8/sqlobject/sresults.py 2007-08-30 14:30:52 UTC (rev 2891)
@@ -36,6 +36,7 @@
"'limit' cannot be used with 'start' or 'end'"
ops["start"] = 0
ops["end"] = ops["limit"]
+ del ops["limit"]
def __repr__(self):
return "<%s at %x>" % (self.__class__.__name__, id(self))
@@ -150,13 +151,13 @@
if self.ops.get('end', None) is not None \
and self.ops['end'] < end:
end = self.ops['end']
- return self.clone(limit=None, start=start, end=end)
+ return self.clone(start=start, end=end)
else:
if value < 0:
return list(iter(self))[value]
else:
start = self.ops.get('start', 0) + value
- return list(self.clone(limit=None, start=start, end=start+1))[0]
+ return list(self.clone(start=start, end=start+1))[0]
def __iter__(self):
# @@: This could be optimized, using a simpler algorithm
@@ -183,10 +184,11 @@
def count(self):
""" Counting elements of current select results """
- assert not self.ops.get('limit'), "'limit' is meaningless with 'distinct'"
+ assert not self.ops.get('start') and not self.ops.get('end'), \
+ "start/end/limit have no meaning with 'count'"
assert not (self.ops.get('distinct') and (self.ops.get('start')
or self.ops.get('end'))), \
- "distinct-counting of sliced objects is not supported"
+ "distinct-counting of sliced objects is not supported"
if self.ops.get('distinct'):
# Column must be specified, so we are using unique ID column.
# COUNT(DISTINCT column) is supported by MySQL and PostgreSQL,
Modified: SQLObject/branches/0.8/sqlobject/tests/test_select.py
===================================================================
--- SQLObject/branches/0.8/sqlobject/tests/test_select.py 2007-08-30 14:30:36 UTC (rev 2890)
+++ SQLObject/branches/0.8/sqlobject/tests/test_select.py 2007-08-30 14:30:52 UTC (rev 2891)
@@ -77,8 +77,7 @@
def test_05_select_limit():
setupIter()
assert len(list(IterTest.select(limit=2))) == 2
- raises(AssertionError, IterTest.select(limit=2).distinct)
- raises(AssertionError, IterTest.select(limit=2).clone, start=1)
+ raises(AssertionError, IterTest.select(limit=2).count)
def test_06_like():
setupIter()
|
|
From: <sub...@co...> - 2007-08-30 14:30:47
|
Author: phd
Date: 2007-08-30 08:30:36 -0600 (Thu, 30 Aug 2007)
New Revision: 2890
Modified:
SQLObject/branches/0.7/docs/News.txt
SQLObject/branches/0.7/sqlobject/sresults.py
SQLObject/branches/0.7/sqlobject/tests/test_select.py
Log:
Remove 'limit' from SelectResults after setting start/end so .clone() never see limit again.
Modified: SQLObject/branches/0.7/docs/News.txt
===================================================================
--- SQLObject/branches/0.7/docs/News.txt 2007-08-23 16:54:33 UTC (rev 2889)
+++ SQLObject/branches/0.7/docs/News.txt 2007-08-30 14:30:36 UTC (rev 2890)
@@ -10,6 +10,12 @@
SQLObject 0.7.9
===============
+Bug Fixes
+---------
+
+* Remove 'limit' from SelectResults after setting start/end so .clone()
+ never see limit again.
+
Other Changes
-------------
Modified: SQLObject/branches/0.7/sqlobject/sresults.py
===================================================================
--- SQLObject/branches/0.7/sqlobject/sresults.py 2007-08-23 16:54:33 UTC (rev 2889)
+++ SQLObject/branches/0.7/sqlobject/sresults.py 2007-08-30 14:30:36 UTC (rev 2890)
@@ -35,6 +35,7 @@
"'limit' cannot be used with 'start' or 'end'"
ops["start"] = 0
ops["end"] = ops["limit"]
+ del ops["limit"]
def __repr__(self):
return "<%s at %x>" % (self.__class__.__name__, id(self))
@@ -145,13 +146,13 @@
if self.ops.get('end', None) is not None \
and self.ops['end'] < end:
end = self.ops['end']
- return self.clone(limit=None, start=start, end=end)
+ return self.clone(start=start, end=end)
else:
if value < 0:
return list(iter(self))[value]
else:
start = self.ops.get('start', 0) + value
- return list(self.clone(limit=None, start=start, end=start+1))[0]
+ return list(self.clone(start=start, end=start+1))[0]
def __iter__(self):
# @@: This could be optimized, using a simpler algorithm
@@ -178,10 +179,11 @@
def count(self):
""" Counting elements of current select results """
- assert not self.ops.get('limit'), "'limit' is meaningless with 'distinct'"
+ assert not self.ops.get('start') and not self.ops.get('end'), \
+ "start/end/limit have no meaning with 'count'"
assert not (self.ops.get('distinct') and (self.ops.get('start')
or self.ops.get('end'))), \
- "distinct-counting of sliced objects is not supported"
+ "distinct-counting of sliced objects is not supported"
if self.ops.get('distinct'):
# Column must be specified, so we are using unique ID column.
# COUNT(DISTINCT column) is supported by MySQL and PostgreSQL,
Modified: SQLObject/branches/0.7/sqlobject/tests/test_select.py
===================================================================
--- SQLObject/branches/0.7/sqlobject/tests/test_select.py 2007-08-23 16:54:33 UTC (rev 2889)
+++ SQLObject/branches/0.7/sqlobject/tests/test_select.py 2007-08-30 14:30:36 UTC (rev 2890)
@@ -75,8 +75,7 @@
def test_05_select_limit():
setupIter()
assert len(list(IterTest.select(limit=2))) == 2
- raises(AssertionError, IterTest.select(limit=2).distinct)
- raises(AssertionError, IterTest.select(limit=2).clone, start=1)
+ raises(AssertionError, IterTest.select(limit=2).count)
def test_06_like():
setupIter()
|
|
From: <o-f...@as...> - 2007-08-28 04:35:26
|
Big News Hits On ERMX. EntreMetrix Inc. (ERMX) $0.089 UP 11.25% Gladiator challenge is now an ERMX asset. It is one of the biggest promoters of mixed martial arts. New dividend opportunities are expected from this asset expansion. Read the news ASAP, and be ready to move at open on Tuesday. |
|
From: <si...@gc...> - 2007-08-28 01:00:46
|
ERMX News Hits. Plans To Expand Dividend Opportunities! EntreMetrix Inc. (ERMX) $0.089 UP 11.25% Gladiator challenge is now an ERMX asset. It is one of the most prolific promoters of live events in the fast growing sport of mixed martial arts. One of the first steps in ERMX's over all plan of Asset expansion to increase dividend opportunities. Check out the release and set your buy for Tuesday morn. |
|
From: SourceForge.net <no...@so...> - 2007-08-26 16:40:53
|
Bugs item #1690105, was opened at 2007-03-28 21:10 Message generated for change (Comment added) made by complex You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1690105&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: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Mirinde Fekus (junas) Assigned to: Nobody/Anonymous (nobody) Summary: UnicodeEncodeError: 'latin-1' codec can't encode characters Initial Comment: I have this http://pylonshq.com/pasties/198 after upgrading mysqldb to 1.2.2 from 1.2.1 when selecting by value that contains non-latin characters: res = list(model.Tag.selectBy(tag = tag)) the connection string is sqlobject.dburi = mysql://****:****@localhost/pyneohuman?sqlobject_encoding=utf-8&charset=utf8 in development.ini so it's not latin-1... any ideas? ---------------------------------------------------------------------- Comment By: Viktor Ferenczi (complex) Date: 2007-08-26 18:40 Message: Logged In: YES user_id=142612 Originator: NO My config: Python 2.5.1, SQLObject 0.9.1, MySQL 4.1.11, MySQL-python-1.2.2 DB with InnoDB tables, utf8_general_ci everywhere. SET NAMES utf8 issued as first SQL statement. This bug also appears in 0.9.1. Now works fine with modified mysql/mysqlconnection.py: @@ -28,10 +28,6 @@ self.user = user self.password = password self.kw = {} - if MySQLdb.version_info[:3] >= (1, 2, 1): - self.need_unicode = True - else: - self.need_unicode = False for key in ("unix_socket", "init_command", "read_default_file", "read_default_group", "conv"): if key in kw: @@ -107,10 +103,6 @@ # done by calling ping(True) on the connection. for count in range(3): try: - # For MySQLdb 1.2.1 and later, we go - # encoding->unicode->charset (in the mysql db) - if self.need_unicode and not isinstance(query, unicode): - query = unicode(query, self.encoding) return cursor.execute(query) except MySQLdb.OperationalError, e: if e.args[0] in (MySQLdb.constants.CR.SERVER_GONE_ERROR, MySQLdb.constants.CR.SERVER_LOST): and DB URI options: ?use_unicode=1&charset=utf8 It seems to me that the need_unicode stuff is somehow buggy and not required, at least in my case. ---------------------------------------------------------------------- Comment By: Mirinde Fekus (junas) Date: 2007-03-29 09:35 Message: Logged In: YES user_id=1304728 Originator: YES SQLObject-0.8.1-py2.4 ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2007-03-28 21:27 Message: Logged In: YES user_id=4799 Originator: NO What is the version of SQLObject? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1690105&group_id=74338 |
|
From: <chr...@we...> - 2007-08-23 06:57:27
|
Big Day Tomorrow EntreMetrix Inc. ERMX $0.06 Watch ERMX Tomorrow! Keep your eyes open for big news on ERMX Thursday. Buy low before the news hits. Get in while the price is low. |
|
From: SourceForge.net <no...@so...> - 2007-08-21 16:16:11
|
Bugs item #1665322, was opened at 2007-02-21 18:30 Message generated for change (Settings changed) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1665322&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 Private: No Submitted By: Leandro Lucarella (llucax) Assigned to: Oleg Broytmann (phd) Summary: InheritableSQLObject childName column in sqlmeta.columns Initial Comment: from sqlobject import * from sqlobject.inheritance import InheritableSQLObject __connection__ = 'sqlite:///:memory:' class Base(InheritableSQLObject): base = IntCol() Base.createTable() print j.Base.sqlmeta.columns {'base': <SOIntCol base>, 'childName': <SOStringCol childName default=None>} I think 'childName' should not be "listed" in sqlmeta.columns because it's a SQLObject "artifact" (just like 'id' column). This complicate automatic conversion from SQLObject to other types (like TurboJson's jsonify_sqlobject() function). ---------------------------------------------------------------------- Comment By: Leandro Lucarella (llucax) Date: 2007-08-21 20:12 Message: Logged In: YES user_id=240225 Originator: YES Well, I think some sort of consistency about SQLObject "artifact" columns being in sqlmeta.columns is desirable, but since the solution is too hard to achieve and the workarround seems reasonable, the bug could be closed. I think Resolution should be Wont Fix, though, as the original problem, as you said, is not really fixed. ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2007-08-21 17:41 Message: Logged In: YES user_id=4799 Originator: NO Initially the bug was opened with a different formulation, but if you think it's ok to close it - let's close it. ---------------------------------------------------------------------- Comment By: Leandro Lucarella (llucax) Date: 2007-08-21 17:31 Message: Logged In: YES user_id=240225 Originator: YES Fair enough. Is this bug ready to be closed? ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2007-08-21 17:08 Message: Logged In: YES user_id=4799 Originator: NO A new method is enough not to apply the patch to a stable branch to prevent 0.9.1 being backward-incompatible with 0.9.2. ---------------------------------------------------------------------- Comment By: Leandro Lucarella (llucax) Date: 2007-08-21 17:00 Message: Logged In: YES user_id=240225 Originator: YES It adds a new method, but why do you say that changes the existing ones? asDict() only changes for inheritable objects (for normal objects asDict() works exactly the same) , but it was broken anyways, so I don't see how this change could break any existing code, if existing code can't use asDict() for inheritable objects. ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2007-08-21 16:54 Message: Logged In: YES user_id=4799 Originator: NO The patch changes the public API - it adds a new method and changes the existing ones - hence it can be applied only to the trunk. I also changed the patch - mostly changed names. Applied and committed in the revisions 2885, 2886. PS. We use py.test, not nosetest. :) ---------------------------------------------------------------------- Comment By: Leandro Lucarella (llucax) Date: 2007-08-21 05:57 Message: Logged In: YES user_id=240225 Originator: YES Here are some untested testcases (I don't know how to use nosetest :) They test asDict(), not getColumn() directly. File Added: sqlobject.r2871.asDict.tests.patch ---------------------------------------------------------------------- Comment By: Leandro Lucarella (llucax) Date: 2007-08-21 05:55 Message: Logged In: YES user_id=240225 Originator: YES This is no exactly a great patch, and doesn't fix the base problem, but it provides a consistent way to get all the meaningfull columns for a user. The patch adds a function getColumns() to the sqlmeta object (and the inheritable version), that allways get all the columns for a class (including parent classes), excluding for the 'childName' column but including the 'id' column. This patch makes asDict() function use getColumns(), so there is no need to override it in the inheritable sqlmeta class. This makes asDict() to work properly on inheritable sqlobjects, avoiding the "AttributeError: 'SomeSQLObject' object has no attribute '_SO_val_childName'" error. File Added: sqlobject.r2871.getColumns.patch ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2007-02-28 14:15 Message: Logged In: YES user_id=4799 Originator: NO Reopened; see bug 1665328 for details. Now waiting for a patch... ---------------------------------------------------------------------- Comment By: Leandro Lucarella (llucax) Date: 2007-02-23 16:22 Message: Logged In: YES user_id=240225 Originator: YES Because it doesn't behave like a real column (1665328 is an example, a regular column is inherited to all it's descendant, and the "None" behavior is another example too) and it's not user data. But I understand you don't see a great advantage on fixing it, i'll try to work on it when I have some time if you agree something is wrong and are interested in patches for this... (and don't want to work on a patch that it will not be accepted). ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2007-02-23 15:35 Message: Logged In: YES user_id=4799 Originator: NO Why is it a bug? It works as advertised. It is a real column, and it presents in .columns. In any case it would be so hard to fix, and fixing it gives so little advantage - I am not going to work on it. But I can test a patch if one appears. ---------------------------------------------------------------------- Comment By: Leandro Lucarella (llucax) Date: 2007-02-23 15:08 Message: Logged In: YES user_id=240225 Originator: YES Ok, it should be hard to fix, but don't you agree it's a bug? Shouldn't be emulated like the "id" column? It's not user data. ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2007-02-22 22:41 Message: Logged In: YES user_id=4799 Originator: NO SQLObject emulates "id" columns. Unlike that fictional column childName is a real column. There is no way to remove it from .columns. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1665322&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2007-08-21 16:12:32
|
Bugs item #1665322, was opened at 2007-02-21 12:30 Message generated for change (Comment added) made by llucax You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1665322&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 Private: No Submitted By: Leandro Lucarella (llucax) Assigned to: Oleg Broytmann (phd) Summary: InheritableSQLObject childName column in sqlmeta.columns Initial Comment: from sqlobject import * from sqlobject.inheritance import InheritableSQLObject __connection__ = 'sqlite:///:memory:' class Base(InheritableSQLObject): base = IntCol() Base.createTable() print j.Base.sqlmeta.columns {'base': <SOIntCol base>, 'childName': <SOStringCol childName default=None>} I think 'childName' should not be "listed" in sqlmeta.columns because it's a SQLObject "artifact" (just like 'id' column). This complicate automatic conversion from SQLObject to other types (like TurboJson's jsonify_sqlobject() function). ---------------------------------------------------------------------- >Comment By: Leandro Lucarella (llucax) Date: 2007-08-21 13:12 Message: Logged In: YES user_id=240225 Originator: YES Well, I think some sort of consistency about SQLObject "artifact" columns being in sqlmeta.columns is desirable, but since the solution is too hard to achieve and the workarround seems reasonable, the bug could be closed. I think Resolution should be Wont Fix, though, as the original problem, as you said, is not really fixed. ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2007-08-21 10:41 Message: Logged In: YES user_id=4799 Originator: NO Initially the bug was opened with a different formulation, but if you think it's ok to close it - let's close it. ---------------------------------------------------------------------- Comment By: Leandro Lucarella (llucax) Date: 2007-08-21 10:31 Message: Logged In: YES user_id=240225 Originator: YES Fair enough. Is this bug ready to be closed? ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2007-08-21 10:08 Message: Logged In: YES user_id=4799 Originator: NO A new method is enough not to apply the patch to a stable branch to prevent 0.9.1 being backward-incompatible with 0.9.2. ---------------------------------------------------------------------- Comment By: Leandro Lucarella (llucax) Date: 2007-08-21 10:00 Message: Logged In: YES user_id=240225 Originator: YES It adds a new method, but why do you say that changes the existing ones? asDict() only changes for inheritable objects (for normal objects asDict() works exactly the same) , but it was broken anyways, so I don't see how this change could break any existing code, if existing code can't use asDict() for inheritable objects. ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2007-08-21 09:54 Message: Logged In: YES user_id=4799 Originator: NO The patch changes the public API - it adds a new method and changes the existing ones - hence it can be applied only to the trunk. I also changed the patch - mostly changed names. Applied and committed in the revisions 2885, 2886. PS. We use py.test, not nosetest. :) ---------------------------------------------------------------------- Comment By: Leandro Lucarella (llucax) Date: 2007-08-20 22:57 Message: Logged In: YES user_id=240225 Originator: YES Here are some untested testcases (I don't know how to use nosetest :) They test asDict(), not getColumn() directly. File Added: sqlobject.r2871.asDict.tests.patch ---------------------------------------------------------------------- Comment By: Leandro Lucarella (llucax) Date: 2007-08-20 22:55 Message: Logged In: YES user_id=240225 Originator: YES This is no exactly a great patch, and doesn't fix the base problem, but it provides a consistent way to get all the meaningfull columns for a user. The patch adds a function getColumns() to the sqlmeta object (and the inheritable version), that allways get all the columns for a class (including parent classes), excluding for the 'childName' column but including the 'id' column. This patch makes asDict() function use getColumns(), so there is no need to override it in the inheritable sqlmeta class. This makes asDict() to work properly on inheritable sqlobjects, avoiding the "AttributeError: 'SomeSQLObject' object has no attribute '_SO_val_childName'" error. File Added: sqlobject.r2871.getColumns.patch ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2007-02-28 08:15 Message: Logged In: YES user_id=4799 Originator: NO Reopened; see bug 1665328 for details. Now waiting for a patch... ---------------------------------------------------------------------- Comment By: Leandro Lucarella (llucax) Date: 2007-02-23 10:22 Message: Logged In: YES user_id=240225 Originator: YES Because it doesn't behave like a real column (1665328 is an example, a regular column is inherited to all it's descendant, and the "None" behavior is another example too) and it's not user data. But I understand you don't see a great advantage on fixing it, i'll try to work on it when I have some time if you agree something is wrong and are interested in patches for this... (and don't want to work on a patch that it will not be accepted). ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2007-02-23 09:35 Message: Logged In: YES user_id=4799 Originator: NO Why is it a bug? It works as advertised. It is a real column, and it presents in .columns. In any case it would be so hard to fix, and fixing it gives so little advantage - I am not going to work on it. But I can test a patch if one appears. ---------------------------------------------------------------------- Comment By: Leandro Lucarella (llucax) Date: 2007-02-23 09:08 Message: Logged In: YES user_id=240225 Originator: YES Ok, it should be hard to fix, but don't you agree it's a bug? Shouldn't be emulated like the "id" column? It's not user data. ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2007-02-22 16:41 Message: Logged In: YES user_id=4799 Originator: NO SQLObject emulates "id" columns. Unlike that fictional column childName is a real column. There is no way to remove it from .columns. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1665322&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2007-08-21 13:42:00
|
Bugs item #1665322, was opened at 2007-02-21 18:30 Message generated for change (Comment added) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1665322&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 Private: No Submitted By: Leandro Lucarella (llucax) Assigned to: Oleg Broytmann (phd) Summary: InheritableSQLObject childName column in sqlmeta.columns Initial Comment: from sqlobject import * from sqlobject.inheritance import InheritableSQLObject __connection__ = 'sqlite:///:memory:' class Base(InheritableSQLObject): base = IntCol() Base.createTable() print j.Base.sqlmeta.columns {'base': <SOIntCol base>, 'childName': <SOStringCol childName default=None>} I think 'childName' should not be "listed" in sqlmeta.columns because it's a SQLObject "artifact" (just like 'id' column). This complicate automatic conversion from SQLObject to other types (like TurboJson's jsonify_sqlobject() function). ---------------------------------------------------------------------- >Comment By: Oleg Broytmann (phd) Date: 2007-08-21 17:41 Message: Logged In: YES user_id=4799 Originator: NO Initially the bug was opened with a different formulation, but if you think it's ok to close it - let's close it. ---------------------------------------------------------------------- Comment By: Leandro Lucarella (llucax) Date: 2007-08-21 17:31 Message: Logged In: YES user_id=240225 Originator: YES Fair enough. Is this bug ready to be closed? ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2007-08-21 17:08 Message: Logged In: YES user_id=4799 Originator: NO A new method is enough not to apply the patch to a stable branch to prevent 0.9.1 being backward-incompatible with 0.9.2. ---------------------------------------------------------------------- Comment By: Leandro Lucarella (llucax) Date: 2007-08-21 17:00 Message: Logged In: YES user_id=240225 Originator: YES It adds a new method, but why do you say that changes the existing ones? asDict() only changes for inheritable objects (for normal objects asDict() works exactly the same) , but it was broken anyways, so I don't see how this change could break any existing code, if existing code can't use asDict() for inheritable objects. ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2007-08-21 16:54 Message: Logged In: YES user_id=4799 Originator: NO The patch changes the public API - it adds a new method and changes the existing ones - hence it can be applied only to the trunk. I also changed the patch - mostly changed names. Applied and committed in the revisions 2885, 2886. PS. We use py.test, not nosetest. :) ---------------------------------------------------------------------- Comment By: Leandro Lucarella (llucax) Date: 2007-08-21 05:57 Message: Logged In: YES user_id=240225 Originator: YES Here are some untested testcases (I don't know how to use nosetest :) They test asDict(), not getColumn() directly. File Added: sqlobject.r2871.asDict.tests.patch ---------------------------------------------------------------------- Comment By: Leandro Lucarella (llucax) Date: 2007-08-21 05:55 Message: Logged In: YES user_id=240225 Originator: YES This is no exactly a great patch, and doesn't fix the base problem, but it provides a consistent way to get all the meaningfull columns for a user. The patch adds a function getColumns() to the sqlmeta object (and the inheritable version), that allways get all the columns for a class (including parent classes), excluding for the 'childName' column but including the 'id' column. This patch makes asDict() function use getColumns(), so there is no need to override it in the inheritable sqlmeta class. This makes asDict() to work properly on inheritable sqlobjects, avoiding the "AttributeError: 'SomeSQLObject' object has no attribute '_SO_val_childName'" error. File Added: sqlobject.r2871.getColumns.patch ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2007-02-28 14:15 Message: Logged In: YES user_id=4799 Originator: NO Reopened; see bug 1665328 for details. Now waiting for a patch... ---------------------------------------------------------------------- Comment By: Leandro Lucarella (llucax) Date: 2007-02-23 16:22 Message: Logged In: YES user_id=240225 Originator: YES Because it doesn't behave like a real column (1665328 is an example, a regular column is inherited to all it's descendant, and the "None" behavior is another example too) and it's not user data. But I understand you don't see a great advantage on fixing it, i'll try to work on it when I have some time if you agree something is wrong and are interested in patches for this... (and don't want to work on a patch that it will not be accepted). ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2007-02-23 15:35 Message: Logged In: YES user_id=4799 Originator: NO Why is it a bug? It works as advertised. It is a real column, and it presents in .columns. In any case it would be so hard to fix, and fixing it gives so little advantage - I am not going to work on it. But I can test a patch if one appears. ---------------------------------------------------------------------- Comment By: Leandro Lucarella (llucax) Date: 2007-02-23 15:08 Message: Logged In: YES user_id=240225 Originator: YES Ok, it should be hard to fix, but don't you agree it's a bug? Shouldn't be emulated like the "id" column? It's not user data. ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2007-02-22 22:41 Message: Logged In: YES user_id=4799 Originator: NO SQLObject emulates "id" columns. Unlike that fictional column childName is a real column. There is no way to remove it from .columns. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1665322&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2007-08-21 13:31:08
|
Bugs item #1665322, was opened at 2007-02-21 12:30 Message generated for change (Comment added) made by llucax You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1665322&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: Wont Fix Priority: 5 Private: No Submitted By: Leandro Lucarella (llucax) Assigned to: Oleg Broytmann (phd) Summary: InheritableSQLObject childName column in sqlmeta.columns Initial Comment: from sqlobject import * from sqlobject.inheritance import InheritableSQLObject __connection__ = 'sqlite:///:memory:' class Base(InheritableSQLObject): base = IntCol() Base.createTable() print j.Base.sqlmeta.columns {'base': <SOIntCol base>, 'childName': <SOStringCol childName default=None>} I think 'childName' should not be "listed" in sqlmeta.columns because it's a SQLObject "artifact" (just like 'id' column). This complicate automatic conversion from SQLObject to other types (like TurboJson's jsonify_sqlobject() function). ---------------------------------------------------------------------- >Comment By: Leandro Lucarella (llucax) Date: 2007-08-21 10:31 Message: Logged In: YES user_id=240225 Originator: YES Fair enough. Is this bug ready to be closed? ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2007-08-21 10:08 Message: Logged In: YES user_id=4799 Originator: NO A new method is enough not to apply the patch to a stable branch to prevent 0.9.1 being backward-incompatible with 0.9.2. ---------------------------------------------------------------------- Comment By: Leandro Lucarella (llucax) Date: 2007-08-21 10:00 Message: Logged In: YES user_id=240225 Originator: YES It adds a new method, but why do you say that changes the existing ones? asDict() only changes for inheritable objects (for normal objects asDict() works exactly the same) , but it was broken anyways, so I don't see how this change could break any existing code, if existing code can't use asDict() for inheritable objects. ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2007-08-21 09:54 Message: Logged In: YES user_id=4799 Originator: NO The patch changes the public API - it adds a new method and changes the existing ones - hence it can be applied only to the trunk. I also changed the patch - mostly changed names. Applied and committed in the revisions 2885, 2886. PS. We use py.test, not nosetest. :) ---------------------------------------------------------------------- Comment By: Leandro Lucarella (llucax) Date: 2007-08-20 22:57 Message: Logged In: YES user_id=240225 Originator: YES Here are some untested testcases (I don't know how to use nosetest :) They test asDict(), not getColumn() directly. File Added: sqlobject.r2871.asDict.tests.patch ---------------------------------------------------------------------- Comment By: Leandro Lucarella (llucax) Date: 2007-08-20 22:55 Message: Logged In: YES user_id=240225 Originator: YES This is no exactly a great patch, and doesn't fix the base problem, but it provides a consistent way to get all the meaningfull columns for a user. The patch adds a function getColumns() to the sqlmeta object (and the inheritable version), that allways get all the columns for a class (including parent classes), excluding for the 'childName' column but including the 'id' column. This patch makes asDict() function use getColumns(), so there is no need to override it in the inheritable sqlmeta class. This makes asDict() to work properly on inheritable sqlobjects, avoiding the "AttributeError: 'SomeSQLObject' object has no attribute '_SO_val_childName'" error. File Added: sqlobject.r2871.getColumns.patch ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2007-02-28 08:15 Message: Logged In: YES user_id=4799 Originator: NO Reopened; see bug 1665328 for details. Now waiting for a patch... ---------------------------------------------------------------------- Comment By: Leandro Lucarella (llucax) Date: 2007-02-23 10:22 Message: Logged In: YES user_id=240225 Originator: YES Because it doesn't behave like a real column (1665328 is an example, a regular column is inherited to all it's descendant, and the "None" behavior is another example too) and it's not user data. But I understand you don't see a great advantage on fixing it, i'll try to work on it when I have some time if you agree something is wrong and are interested in patches for this... (and don't want to work on a patch that it will not be accepted). ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2007-02-23 09:35 Message: Logged In: YES user_id=4799 Originator: NO Why is it a bug? It works as advertised. It is a real column, and it presents in .columns. In any case it would be so hard to fix, and fixing it gives so little advantage - I am not going to work on it. But I can test a patch if one appears. ---------------------------------------------------------------------- Comment By: Leandro Lucarella (llucax) Date: 2007-02-23 09:08 Message: Logged In: YES user_id=240225 Originator: YES Ok, it should be hard to fix, but don't you agree it's a bug? Shouldn't be emulated like the "id" column? It's not user data. ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2007-02-22 16:41 Message: Logged In: YES user_id=4799 Originator: NO SQLObject emulates "id" columns. Unlike that fictional column childName is a real column. There is no way to remove it from .columns. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1665322&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2007-08-21 13:08:47
|
Bugs item #1665322, was opened at 2007-02-21 18:30 Message generated for change (Comment added) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1665322&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: Wont Fix Priority: 5 Private: No Submitted By: Leandro Lucarella (llucax) Assigned to: Oleg Broytmann (phd) Summary: InheritableSQLObject childName column in sqlmeta.columns Initial Comment: from sqlobject import * from sqlobject.inheritance import InheritableSQLObject __connection__ = 'sqlite:///:memory:' class Base(InheritableSQLObject): base = IntCol() Base.createTable() print j.Base.sqlmeta.columns {'base': <SOIntCol base>, 'childName': <SOStringCol childName default=None>} I think 'childName' should not be "listed" in sqlmeta.columns because it's a SQLObject "artifact" (just like 'id' column). This complicate automatic conversion from SQLObject to other types (like TurboJson's jsonify_sqlobject() function). ---------------------------------------------------------------------- >Comment By: Oleg Broytmann (phd) Date: 2007-08-21 17:08 Message: Logged In: YES user_id=4799 Originator: NO A new method is enough not to apply the patch to a stable branch to prevent 0.9.1 being backward-incompatible with 0.9.2. ---------------------------------------------------------------------- Comment By: Leandro Lucarella (llucax) Date: 2007-08-21 17:00 Message: Logged In: YES user_id=240225 Originator: YES It adds a new method, but why do you say that changes the existing ones? asDict() only changes for inheritable objects (for normal objects asDict() works exactly the same) , but it was broken anyways, so I don't see how this change could break any existing code, if existing code can't use asDict() for inheritable objects. ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2007-08-21 16:54 Message: Logged In: YES user_id=4799 Originator: NO The patch changes the public API - it adds a new method and changes the existing ones - hence it can be applied only to the trunk. I also changed the patch - mostly changed names. Applied and committed in the revisions 2885, 2886. PS. We use py.test, not nosetest. :) ---------------------------------------------------------------------- Comment By: Leandro Lucarella (llucax) Date: 2007-08-21 05:57 Message: Logged In: YES user_id=240225 Originator: YES Here are some untested testcases (I don't know how to use nosetest :) They test asDict(), not getColumn() directly. File Added: sqlobject.r2871.asDict.tests.patch ---------------------------------------------------------------------- Comment By: Leandro Lucarella (llucax) Date: 2007-08-21 05:55 Message: Logged In: YES user_id=240225 Originator: YES This is no exactly a great patch, and doesn't fix the base problem, but it provides a consistent way to get all the meaningfull columns for a user. The patch adds a function getColumns() to the sqlmeta object (and the inheritable version), that allways get all the columns for a class (including parent classes), excluding for the 'childName' column but including the 'id' column. This patch makes asDict() function use getColumns(), so there is no need to override it in the inheritable sqlmeta class. This makes asDict() to work properly on inheritable sqlobjects, avoiding the "AttributeError: 'SomeSQLObject' object has no attribute '_SO_val_childName'" error. File Added: sqlobject.r2871.getColumns.patch ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2007-02-28 14:15 Message: Logged In: YES user_id=4799 Originator: NO Reopened; see bug 1665328 for details. Now waiting for a patch... ---------------------------------------------------------------------- Comment By: Leandro Lucarella (llucax) Date: 2007-02-23 16:22 Message: Logged In: YES user_id=240225 Originator: YES Because it doesn't behave like a real column (1665328 is an example, a regular column is inherited to all it's descendant, and the "None" behavior is another example too) and it's not user data. But I understand you don't see a great advantage on fixing it, i'll try to work on it when I have some time if you agree something is wrong and are interested in patches for this... (and don't want to work on a patch that it will not be accepted). ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2007-02-23 15:35 Message: Logged In: YES user_id=4799 Originator: NO Why is it a bug? It works as advertised. It is a real column, and it presents in .columns. In any case it would be so hard to fix, and fixing it gives so little advantage - I am not going to work on it. But I can test a patch if one appears. ---------------------------------------------------------------------- Comment By: Leandro Lucarella (llucax) Date: 2007-02-23 15:08 Message: Logged In: YES user_id=240225 Originator: YES Ok, it should be hard to fix, but don't you agree it's a bug? Shouldn't be emulated like the "id" column? It's not user data. ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2007-02-22 22:41 Message: Logged In: YES user_id=4799 Originator: NO SQLObject emulates "id" columns. Unlike that fictional column childName is a real column. There is no way to remove it from .columns. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1665322&group_id=74338 |