sqlobject-cvs Mailing List for SQLObject (Page 72)
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
(9) |
Apr
(74) |
May
(29) |
Jun
(16) |
Jul
(28) |
Aug
(10) |
Sep
(57) |
Oct
(9) |
Nov
(29) |
Dec
(12) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(7) |
Feb
(14) |
Mar
(6) |
Apr
(3) |
May
(12) |
Jun
(34) |
Jul
(9) |
Aug
(29) |
Sep
(22) |
Oct
(2) |
Nov
(15) |
Dec
(52) |
| 2005 |
Jan
(47) |
Feb
(78) |
Mar
(14) |
Apr
(35) |
May
(33) |
Jun
(16) |
Jul
(26) |
Aug
(63) |
Sep
(40) |
Oct
(96) |
Nov
(96) |
Dec
(123) |
| 2006 |
Jan
(159) |
Feb
(144) |
Mar
(64) |
Apr
(31) |
May
(88) |
Jun
(48) |
Jul
(16) |
Aug
(64) |
Sep
(87) |
Oct
(92) |
Nov
(56) |
Dec
(76) |
| 2007 |
Jan
(94) |
Feb
(103) |
Mar
(126) |
Apr
(123) |
May
(85) |
Jun
(11) |
Jul
(130) |
Aug
(47) |
Sep
(65) |
Oct
(70) |
Nov
(12) |
Dec
(11) |
| 2008 |
Jan
(30) |
Feb
(55) |
Mar
(88) |
Apr
(20) |
May
(50) |
Jun
|
Jul
(38) |
Aug
(1) |
Sep
(9) |
Oct
(5) |
Nov
(6) |
Dec
(39) |
| 2009 |
Jan
(8) |
Feb
(16) |
Mar
(3) |
Apr
(33) |
May
(44) |
Jun
(1) |
Jul
(10) |
Aug
(33) |
Sep
(74) |
Oct
(22) |
Nov
|
Dec
(15) |
| 2010 |
Jan
(28) |
Feb
(22) |
Mar
(46) |
Apr
(29) |
May
(1) |
Jun
(1) |
Jul
(27) |
Aug
(8) |
Sep
(5) |
Oct
(33) |
Nov
(24) |
Dec
(41) |
| 2011 |
Jan
(4) |
Feb
(12) |
Mar
(35) |
Apr
(29) |
May
(19) |
Jun
(16) |
Jul
(32) |
Aug
(25) |
Sep
(5) |
Oct
(11) |
Nov
(21) |
Dec
(12) |
| 2012 |
Jan
(3) |
Feb
(4) |
Mar
(20) |
Apr
(4) |
May
(25) |
Jun
(13) |
Jul
|
Aug
|
Sep
(2) |
Oct
(25) |
Nov
(9) |
Dec
(1) |
| 2013 |
Jan
(6) |
Feb
(8) |
Mar
|
Apr
(10) |
May
(31) |
Jun
(7) |
Jul
(18) |
Aug
(33) |
Sep
(4) |
Oct
(16) |
Nov
|
Dec
(27) |
| 2014 |
Jan
(2) |
Feb
|
Mar
|
Apr
(11) |
May
(39) |
Jun
(8) |
Jul
(11) |
Aug
(4) |
Sep
|
Oct
(27) |
Nov
|
Dec
(71) |
| 2015 |
Jan
(17) |
Feb
(47) |
Mar
(33) |
Apr
|
May
|
Jun
(9) |
Jul
(7) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(8) |
| 2016 |
Jan
(4) |
Feb
(4) |
Mar
|
Apr
|
May
(12) |
Jun
(7) |
Jul
(9) |
Aug
(31) |
Sep
(8) |
Oct
(3) |
Nov
(15) |
Dec
(1) |
| 2017 |
Jan
(13) |
Feb
(7) |
Mar
(14) |
Apr
(8) |
May
(10) |
Jun
(4) |
Jul
(2) |
Aug
(1) |
Sep
|
Oct
(8) |
Nov
(4) |
Dec
(5) |
| 2018 |
Jan
(2) |
Feb
(8) |
Mar
|
Apr
(4) |
May
|
Jun
(6) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2019 |
Jan
(1) |
Feb
(16) |
Mar
(1) |
Apr
(3) |
May
(5) |
Jun
(1) |
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
(1) |
Dec
(3) |
| 2020 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(1) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
(2) |
Nov
|
Dec
(2) |
| 2021 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(1) |
Dec
|
| 2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(6) |
Oct
(1) |
Nov
(1) |
Dec
(4) |
| 2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(3) |
Sep
(2) |
Oct
(2) |
Nov
(4) |
Dec
|
| 2024 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(9) |
| 2025 |
Jan
|
Feb
(4) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
(2) |
Dec
(2) |
|
From: <sub...@co...> - 2008-03-03 16:09:07
|
Author: phd
Date: 2008-03-03 09:09:00 -0700 (Mon, 03 Mar 2008)
New Revision: 3281
Modified:
SQLObject/branches/0.10/docs/News.txt
SQLObject/branches/0.10/sqlobject/inheritance/__init__.py
SQLObject/branches/0.10/sqlobject/sqlbuilder.py
SQLObject/branches/0.10/sqlobject/sresults.py
SQLObject/branches/0.10/sqlobject/tests/test_sqlbuilder_importproxy.py
Log:
Applied a patch 1673015 by Leandro Lucarella:
use sets instead of dicts in tablesUsed. Dropped tablesUsedDict function;
instead there is tablesUsedSet that returns a set of strings.
Modified: SQLObject/branches/0.10/docs/News.txt
===================================================================
--- SQLObject/branches/0.10/docs/News.txt 2008-03-03 13:28:10 UTC (rev 3280)
+++ SQLObject/branches/0.10/docs/News.txt 2008-03-03 16:09:00 UTC (rev 3281)
@@ -32,8 +32,6 @@
* SQLBuilder Joins handle SQLExpression tables (not just str/SQLObject/Alias)
and properly sqlrepr.
-* SQLBuilder tablesUsedDict handles sqlrepr'able objects.
-
* Added SQLBuilder ImportProxy. It allows one to ignore the circular import
issues with referring to SQLObject classes in other files - it uses the
classregistry as the string class names for FK/Joins do, but specifically
@@ -72,6 +70,11 @@
* MySQLConnection (and DB URI) accept a number of SSL-related parameters:
ssl_key, ssl_cert, ssl_ca, ssl_capath.
+* Use sets instead of dicts in tablesUsed. Dropped tablesUsedDict function;
+ instead there is tablesUsedSet that returns a set of strings.
+
+* SQLBuilder tablesUsedDict handles sqlrepr'able objects.
+
SQLObject 0.9.4
===============
Modified: SQLObject/branches/0.10/sqlobject/inheritance/__init__.py
===================================================================
--- SQLObject/branches/0.10/sqlobject/inheritance/__init__.py 2008-03-03 13:28:10 UTC (rev 3280)
+++ SQLObject/branches/0.10/sqlobject/inheritance/__init__.py 2008-03-03 16:09:00 UTC (rev 3281)
@@ -5,17 +5,22 @@
makeProperties, getterName, setterName
import iteration
+try:
+ set
+except NameError: # Python 2.3
+ from sets import Set, ImmutableSet
+ set, frozenset = Set, ImmutableSet
-def tablesUsedDict(obj, db):
- if hasattr(obj, "tablesUsedDict"):
- return obj.tablesUsedDict(db)
- elif isinstance(obj, (tuple, list)):
- d = {}
+def tablesUsedSet(obj, db):
+ if hasattr(obj, "tablesUsedSet"):
+ return obj.tablesUsedSet(db)
+ elif isinstance(obj, (tuple, list, set, frozenset)):
+ s = set()
for component in obj:
- d.update(tablesUsedDict(component, db))
- return d
+ s.update(tablesUsedSet(component, db))
+ return s
else:
- return {}
+ return set()
class InheritableSelectResults(SelectResults):
@@ -28,14 +33,14 @@
dbName = (ops.get('connection',None) or sourceClass._connection).dbName
- tablesDict = tablesUsedDict(clause, dbName)
- tablesDict[str(sourceClass.sqlmeta.table)] = 1
+ tablesSet = tablesUsedSet(clause, dbName)
+ tablesSet.add(str(sourceClass.sqlmeta.table))
orderBy = ops.get('orderBy')
if inheritedTables:
for tableName in inheritedTables:
- tablesDict[str(tableName)] = 1
+ tablesSet.add(str(tableName))
if orderBy and not isinstance(orderBy, basestring):
- tablesDict.update(tablesUsedDict(orderBy, dbName))
+ tablesSet.update(tablesUsedSet(orderBy, dbName))
#DSM: if this class has a parent, we need to link it
#DSM: and be sure the parent is in the table list.
#DSM: The following code is before clauseTables
@@ -47,7 +52,7 @@
allClasses = classregistry.registry(
sourceClass.sqlmeta.registry).allClasses()
for registryClass in allClasses:
- if str(registryClass.sqlmeta.table) in tablesDict:
+ if str(registryClass.sqlmeta.table) in tablesSet:
#DSM: By default, no parents are needed for the clauses
tableRegistry[registryClass] = registryClass
tableRegistryCopy = tableRegistry.copy()
@@ -74,7 +79,7 @@
parentClass = currentClass.sqlmeta.parentClass
parentClause.append(currentClass.q.id == parentClass.q.id)
currentClass = parentClass
- tablesDict[str(currentClass.sqlmeta.table)] = 1
+ tablesSet.add(str(currentClass.sqlmeta.table))
clause = reduce(sqlbuilder.AND, parentClause, clause)
super(InheritableSelectResults, self).__init__(sourceClass,
Modified: SQLObject/branches/0.10/sqlobject/sqlbuilder.py
===================================================================
--- SQLObject/branches/0.10/sqlobject/sqlbuilder.py 2008-03-03 13:28:10 UTC (rev 3280)
+++ SQLObject/branches/0.10/sqlobject/sqlbuilder.py 2008-03-03 16:09:00 UTC (rev 3281)
@@ -67,6 +67,12 @@
class NoDefault:
pass
+try:
+ set
+except NameError: # Python 2.3
+ from sets import Set, ImmutableSet
+ set, frozenset = Set, ImmutableSet
+
import re, fnmatch
import operator
import threading
@@ -182,15 +188,15 @@
return []
def tablesUsed(self, db):
- return self.tablesUsedDict(db).keys()
- def tablesUsedDict(self, db):
- tables = {}
+ return self.tablesUsedSet(db)
+ def tablesUsedSet(self, db):
+ tables = set()
for table in self.tablesUsedImmediate():
if hasattr(table, '__sqlrepr__'):
table = sqlrepr(table, db)
- tables[table] = 1
+ tables.add(table)
for component in self.components():
- tables.update(tablesUsedDict(component, db))
+ tables.update(tablesUsedSet(component, db))
return tables
def tablesUsedImmediate(self):
return []
@@ -204,9 +210,9 @@
registerConverter(SQLExpression, SQLExprConverter)
-def tablesUsedDict(obj, db):
- if hasattr(obj, "tablesUsedDict"):
- return obj.tablesUsedDict(db)
+def tablesUsedSet(obj, db):
+ if hasattr(obj, "tablesUsedSet"):
+ return obj.tablesUsedSet(db)
else:
return {}
@@ -613,22 +619,21 @@
join.append(_join)
else:
join.extend(_join)
- tables = {}
+ tables = set()
for x in self.ops['staticTables']:
if isinstance(x, SQLExpression):
x = sqlrepr(x, db)
- tables[x] = 1
+ tables.add(x)
things = list(self.ops['items']) + join
if self.ops['clause'] is not NoDefault:
things.append(self.ops['clause'])
for thing in things:
if isinstance(thing, SQLExpression):
- tables.update(tablesUsedDict(thing, db))
+ tables.update(tablesUsedSet(thing, db))
for j in join:
t1, t2 = sqlrepr(j.table1, db), sqlrepr(j.table2, db)
- if t1 in tables: del tables[t1]
- if t2 in tables: del tables[t2]
- tables = tables.keys()
+ if t1 in tables: tables.remove(t1)
+ if t2 in tables: tables.remove(t2)
if tables:
select += " FROM %s" % ", ".join(tables)
elif join:
Modified: SQLObject/branches/0.10/sqlobject/sresults.py
===================================================================
--- SQLObject/branches/0.10/sqlobject/sresults.py 2008-03-03 13:28:10 UTC (rev 3280)
+++ SQLObject/branches/0.10/sqlobject/sresults.py 2008-03-03 16:09:00 UTC (rev 3281)
@@ -31,13 +31,13 @@
ops["start"] = 0
ops["end"] = ops.pop("limit")
- tablesDict = sqlbuilder.tablesUsedDict(self.clause, self._getConnection().dbName)
+ tablesSet = sqlbuilder.tablesUsedSet(self.clause, self._getConnection().dbName)
if clauseTables:
for table in clauseTables:
- tablesDict[table] = 1
+ tablesSet.add(table)
self.clauseTables = clauseTables
# Explicitly post-adding-in sqlmeta.table, sqlbuilder.Select will handle sqlrepr'ing and dupes
- self.tables = tablesDict.keys() + [sourceClass.sqlmeta.table]
+ self.tables = list(tablesSet) + [sourceClass.sqlmeta.table]
def queryForSelect(self):
columns = [self.sourceClass.q.id] + [getattr(self.sourceClass.q, x.name) for x in self.sourceClass.sqlmeta.columnList]
Modified: SQLObject/branches/0.10/sqlobject/tests/test_sqlbuilder_importproxy.py
===================================================================
--- SQLObject/branches/0.10/sqlobject/tests/test_sqlbuilder_importproxy.py 2008-03-03 13:28:10 UTC (rev 3280)
+++ SQLObject/branches/0.10/sqlobject/tests/test_sqlbuilder_importproxy.py 2008-03-03 16:09:00 UTC (rev 3281)
@@ -3,49 +3,55 @@
from sqlobject.views import *
from sqlobject.sqlbuilder import ImportProxy, Alias
+try:
+ set
+except NameError: # Python 2.3
+ from sets import Set
+ set = Set
+
def testSimple():
nyi = ImportProxy('NotYetImported')
x = nyi.q.name
-
+
class NotYetImported(SQLObject):
name = StringCol(dbName='a_name')
-
+
y = nyi.q.name
-
+
assert str(x) == 'not_yet_imported.a_name'
assert str(y) == 'not_yet_imported.a_name'
def testAddition():
nyi = ImportProxy('NotYetImported2')
x = nyi.q.name+nyi.q.name
-
+
class NotYetImported2(SQLObject):
name = StringCol(dbName='a_name')
-
+
assert str(x) == '((not_yet_imported2.a_name) + (not_yet_imported2.a_name))'
-
+
def testOnView():
nyi = ImportProxy('NotYetImportedV')
x = nyi.q.name
-
+
class NotYetImported3(SQLObject):
name = StringCol(dbName='a_name')
-
+
class NotYetImportedV(ViewSQLObject):
class sqlmeta:
idName = NotYetImported3.q.id
name = StringCol(dbName=NotYetImported3.q.name)
-
+
assert str(x) == 'not_yet_imported_v.name'
-
+
def testAlias():
nyi = ImportProxy('NotYetImported4')
y = Alias(nyi, 'y')
x = y.q.name
-
+
class NotYetImported4(SQLObject):
name = StringCol(dbName='a_name')
-
+
assert str(y) == 'not_yet_imported4 y'
- assert tablesUsedDict(x, None).keys() == ['not_yet_imported4 y']
- assert str(x) == 'y.a_name'
\ No newline at end of file
+ assert tablesUsedSet(x, None) == set(['not_yet_imported4 y'])
+ assert str(x) == 'y.a_name'
|
|
From: SourceForge.net <no...@so...> - 2008-03-03 15:15:39
|
Patches item #1673015, was opened at 2007-03-03 11:26 Message generated for change (Comment added) made by llucax You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1673015&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 Private: No Submitted By: Leandro Lucarella (llucax) Assigned to: Oleg Broytmann (phd) Summary: Use sets instead of dicts for used tables. Initial Comment: Since dicts are used as plain sets there, why not to just use sets? Yeah, I know, because of Python 2.2 compatibility :) Maybe some day... ---------------------------------------------------------------------- >Comment By: Leandro Lucarella (llucax) Date: 2008-03-03 12:15 Message: Logged In: YES user_id=240225 Originator: YES Sure, sorry about that... File Added: tablesdict.str.set-0.10.patch ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2008-03-03 12:04 Message: Logged In: YES user_id=4799 Originator: NO Thank you. There is also a tables dict in the method Select.__sqlrepr__(). Can you update it, too? (sqlbuilder.py, lines 622-632). ---------------------------------------------------------------------- Comment By: Leandro Lucarella (llucax) Date: 2008-03-03 11:10 Message: Logged In: YES user_id=240225 Originator: YES Patch agains 0.10 attached. File Added: tablesdict.str.set-0.10.patch ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2008-03-03 10:19 Message: Logged In: YES user_id=4799 Originator: NO Please recreate the patch against the 0.10 branch: tablesUsedDict() has an additional parameter 'db'. ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2007-03-27 11:21 Message: Logged In: YES user_id=4799 Originator: NO Will be applied after SQLObject would have switched to Python 2.3. ---------------------------------------------------------------------- Comment By: Leandro Lucarella (llucax) Date: 2007-03-03 11:27 Message: Logged In: YES user_id=240225 Originator: YES File Added: tablesdict.str.set-trunk.patch ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1673015&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2008-03-03 15:04:31
|
Patches item #1673015, was opened at 2007-03-03 17:26 Message generated for change (Comment added) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1673015&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 Private: No Submitted By: Leandro Lucarella (llucax) Assigned to: Oleg Broytmann (phd) Summary: Use sets instead of dicts for used tables. Initial Comment: Since dicts are used as plain sets there, why not to just use sets? Yeah, I know, because of Python 2.2 compatibility :) Maybe some day... ---------------------------------------------------------------------- >Comment By: Oleg Broytmann (phd) Date: 2008-03-03 18:04 Message: Logged In: YES user_id=4799 Originator: NO Thank you. There is also a tables dict in the method Select.__sqlrepr__(). Can you update it, too? (sqlbuilder.py, lines 622-632). ---------------------------------------------------------------------- Comment By: Leandro Lucarella (llucax) Date: 2008-03-03 17:10 Message: Logged In: YES user_id=240225 Originator: YES Patch agains 0.10 attached. File Added: tablesdict.str.set-0.10.patch ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2008-03-03 16:19 Message: Logged In: YES user_id=4799 Originator: NO Please recreate the patch against the 0.10 branch: tablesUsedDict() has an additional parameter 'db'. ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2007-03-27 18:21 Message: Logged In: YES user_id=4799 Originator: NO Will be applied after SQLObject would have switched to Python 2.3. ---------------------------------------------------------------------- Comment By: Leandro Lucarella (llucax) Date: 2007-03-03 17:27 Message: Logged In: YES user_id=240225 Originator: YES File Added: tablesdict.str.set-trunk.patch ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1673015&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2008-03-03 14:48:20
|
Patches item #1653898, was opened at 2007-02-07 10:57 Message generated for change (Comment added) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1653898&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: Accepted Priority: 5 Private: No Submitted By: Maxim F. Ischenko (mfi) Assigned to: Oleg Broytmann (phd) Summary: proper init mysql conn encoding Initial Comment: Current implementation of the mysqlconnection.py accepts 'sqlobject_encoding' and 'charset' parameters but doesn't quite properly use them. In particular, MySQLdb does query.encode(charset) call in execute() where charset is taken from conn.get_character_name(). The problem is - SQLObject never initializes it properly. This one-line patch fixes it by adding a call to conn.set_character_set() in makeConnection() helper. Index: sqlobject/mysql/mysqlconnection.py =================================================================== --- sqlobject/mysql/mysqlconnection.py (revision 2269) +++ sqlobject/mysql/mysqlconnection.py (working copy) @@ -62,6 +62,8 @@ if hasattr(conn, 'autocommit'): conn.autocommit(bool(self.autoCommit)) + conn.set_character_set(self.encoding) + return conn def _setAutoCommit(self, conn, auto): ---------------------------------------------------------------------- >Comment By: Oleg Broytmann (phd) Date: 2008-03-03 17:48 Message: Logged In: YES user_id=4799 Originator: NO Some parts of the patch have been applied, some have not; SQLObject doesn't use "sqlobject_encoding" since 0.7.10, e.g. ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2007-04-25 18:57 Message: Logged In: YES user_id=4799 Originator: NO I applied a pert of the patch, but I didn't apply the UnicodeStringLikeConvertor (I have to think about it a bit more to find problems with the part) and dbEncoding/sqlobject_encoding unification. Committed in the revisions 2593-2597 (0.7, 0.8, 0.9, trunk and docs). Thank you! ---------------------------------------------------------------------- Comment By: Maxim F. Ischenko (mfi) Date: 2007-02-07 17:54 Message: Logged In: YES user_id=113894 Originator: YES Note that I also had to tweak UnicodeStringLikeConvertor so that unicode parameters are encoded into utf8. Without this tweak I got errors like this one when unicode parameters are passed into queries built with sqlbuilder: File "/home/max/oss-projects/SQLObject-0.7/sqlobject/sqlbuilder.py", line 237, in __sqlrepr__ return "(%s %s %s)" % (s1, self.op, s2) UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 19: ordinal not in range(128) The converter trick is controversial but I haven't found a better solution. ;( ---------------------------------------------------------------------- Comment By: Maxim F. Ischenko (mfi) Date: 2007-02-07 17:46 Message: Logged In: YES user_id=113894 Originator: YES It was tested against MySQL 4.1 (5.x should work while 4.0 shouldn't) and MySQLdb driver versions 1.2.0 and 1.2.1. I only tested it with utf8 encoding, the other ones like latin1 should work though I don't know why would you want to use them. ---------------------------------------------------------------------- Comment By: Maxim F. Ischenko (mfi) Date: 2007-02-07 17:44 Message: Logged In: YES user_id=113894 Originator: YES Please ignore that one-line fix; it won't work with MySQLdb 1.2.0 and there are other issues as I have discovered during testing. I attached new patch which is quite more involved. ;) ---------------------------------------------------------------------- Comment By: Maxim F. Ischenko (mfi) Date: 2007-02-07 17:42 Message: Logged In: YES user_id=113894 Originator: YES File Added: mysql_charset.patch ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2007-02-07 11:34 Message: Logged In: YES user_id=4799 Originator: NO Thank you. Does all MySQLdb versions have the call or have I test "if hasattr(conn, 'set_character_set')"? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1653898&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2008-03-03 14:44:28
|
Patches item #1432078, was opened at 2006-02-15 13:56 Message generated for change (Comment added) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1432078&group_id=74338 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None >Status: Closed >Resolution: Invalid Priority: 5 Private: No Submitted By: Etienne Posthumus (epoz) Assigned to: Oleg Broytmann (phd) Summary: Add DISTINCT to sqlbuilder.py Select Initial Comment: When using SQLBuilder do build database-independent queries, I would like to do DISTINCT queries. This already exists in normal SQLObject ClassName.select, but not in the builder. This tiny patch adds it. ---------------------------------------------------------------------- >Comment By: Oleg Broytmann (phd) Date: 2008-03-03 17:43 Message: Logged In: YES user_id=4799 Originator: NO Select() supports "distinct" since 0.10. The implementation is different, though... ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2006-02-20 18:05 Message: Logged In: YES user_id=4799 First, I would like to ask you to avoid copy/paste programming. (-: Please refactor your code - there is duplicate code in 'if' and 'else' branches. I think you can just conditionally insert "DISTINCT" or '' (an empty string). Second, I'd like to ask you to add a test. May be create test_sqlbuilder.py, and test assert str(Select(...)) = "SELECT..." Something like this... Third, it would be very kind of you if you add a few strings about Select() to docs/SQLBuilder.txt - now when you understand sqlbuilder and Select(). Thank you in advance! ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1432078&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2008-03-03 14:43:01
|
Patches item #1904874, was opened at 2008-02-29 21:15 Message generated for change (Settings changed) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1904874&group_id=74338 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None >Status: Closed >Resolution: Invalid Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Oleg Broytmann (phd) Summary: connectionForURI fails for mssql on Cygwin Initial Comment: when running connectionForURI on connection_string='mssql://user:password@host:port/database' the pymssql.connect is called with "host" (port is stripped) however, the called _mssql.connect() (pymssql:line 329) doesn't work unless the port is also specified. Here's the trace: Traceback (most recent call last): File "<stdin>", line 28, in <module> File "/usr/lib/python2.5/site-packages/SQLObject-0.10.0b3-py2.5.egg/sqlobject/main.py", line 880, in get val._init(id, connection, selectResults) File "/usr/lib/python2.5/site-packages/SQLObject-0.10.0b3-py2.5.egg/sqlobject/main.py", line 919, in _init selectResults = self._connection._SO_selectOne(self, dbNames) File "/usr/lib/python2.5/site-packages/SQLObject-0.10.0b3-py2.5.egg/sqlobject/dbconnection.py", line 514, in _SO_selectOne return self._SO_selectOneAlt(so, columnNames, so.q.id==so.id) File "/usr/lib/python2.5/site-packages/SQLObject-0.10.0b3-py2.5.egg/sqlobject/dbconnection.py", line 524, in _SO_selectOneAlt clause=condition))) File "/usr/lib/python2.5/site-packages/SQLObject-0.10.0b3-py2.5.egg/sqlobject/dbconnection.py", line 380, in queryOne return self._runWithConnection(self._queryOne, s) File "/usr/lib/python2.5/site-packages/SQLObject-0.10.0b3-py2.5.egg/sqlobject/dbconnection.py", line 248, in _runWithConnection conn = self.getConnection() File "/usr/lib/python2.5/site-packages/SQLObject-0.10.0b3-py2.5.egg/sqlobject/dbconnection.py", line 259, in getConnection conn = self.makeConnection() File "/usr/lib/python2.5/site-packages/SQLObject-0.10.0b3-py2.5.egg/sqlobject/mssql/mssqlconnection.py", line 83, in makeConnection con = self.dbconnection( *self.make_conn_str(self) ) File "/usr/lib/python2.5/site-packages/pymssql.py", line 328, in connect con = _mssql.connect(dbhost, dbuser, dbpasswd) _mssql.error: DB-Lib error message 20009, severity 9: Server is unavailable or does not exist. my quick correction replaces con = _mssql.connect(dbhost, dbuser, dbpasswd) to con = _mssql.connect(dbhost+":1433", dbuser, dbpasswd) Thank you. ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2008-03-03 16:02 Message: Logged In: YES user_id=4799 Originator: NO You've patched pymssql which is not a part of SQLObject. I think you should report the problem to pymssql authors, no? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1904874&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2008-03-03 14:10:11
|
Patches item #1673015, was opened at 2007-03-03 11:26 Message generated for change (Comment added) made by llucax You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1673015&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 Private: No Submitted By: Leandro Lucarella (llucax) Assigned to: Oleg Broytmann (phd) Summary: Use sets instead of dicts for used tables. Initial Comment: Since dicts are used as plain sets there, why not to just use sets? Yeah, I know, because of Python 2.2 compatibility :) Maybe some day... ---------------------------------------------------------------------- >Comment By: Leandro Lucarella (llucax) Date: 2008-03-03 11:10 Message: Logged In: YES user_id=240225 Originator: YES Patch agains 0.10 attached. File Added: tablesdict.str.set-0.10.patch ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2008-03-03 10:19 Message: Logged In: YES user_id=4799 Originator: NO Please recreate the patch against the 0.10 branch: tablesUsedDict() has an additional parameter 'db'. ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2007-03-27 11:21 Message: Logged In: YES user_id=4799 Originator: NO Will be applied after SQLObject would have switched to Python 2.3. ---------------------------------------------------------------------- Comment By: Leandro Lucarella (llucax) Date: 2007-03-03 11:27 Message: Logged In: YES user_id=240225 Originator: YES File Added: tablesdict.str.set-trunk.patch ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1673015&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2008-03-03 13:56:29
|
Patches item #1904948, was opened at 2008-02-29 23:46 Message generated for change (Comment added) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1904948&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: Works For Me Priority: 5 Private: No Submitted By: Vitalije Milosevic (vitalije) Assigned to: Oleg Broytmann (phd) Summary: sqlite URI is not handled right on windows Initial Comment: On Windows machine when I try to connect to some sqlite database file, I am receiving error message that says it was not possible to create (or open) file. I was inspecting code and found that path which is parsed from given URI starts with '/', and on Windows no valid path starts with '/'. I send in attachment new version of sqliteconnection.py with three lines which on windows platform strips unwanted '/' from the left of path. ---------------------------------------------------------------------- >Comment By: Oleg Broytmann (phd) Date: 2008-03-03 16:56 Message: Logged In: YES user_id=4799 Originator: NO It is not possible to use relative path, and I don't want to add the feature to SQLObject. But it is possible to use a full path with drive letter - just use a vertical bar as a separator instead of colon: db_uri = "sqlite:/C|/path/to/my.db" If that doesn't work for you - show the URI that causes problem. ---------------------------------------------------------------------- Comment By: Vitalije Milosevic (vitalije) Date: 2008-03-03 16:47 Message: Logged In: YES user_id=2023531 Originator: YES Thank you for explanation that '/' is root of the current disk. I didn't know that so I have tried all kinds of paths that were including disk name. Still, it seems to me that it is impossible to make connection to the file that exists on some other disk. Neither it is possible to make connection to the file given by its relative path. Ok, I know it is possible to find absolute path from relative one, than strip disk part of absolute path, but it seems too complicated. Anyway, thank you for your response. ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2008-03-03 16:05 Message: Logged In: YES user_id=4799 Originator: NO What DB URI causes a problem for you? PS. On Windows there are valid paths that start with '/' because / is the root of the current disk. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1904948&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2008-03-03 13:47:12
|
Patches item #1904948, was opened at 2008-02-29 21:46 Message generated for change (Comment added) made by vitalije You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1904948&group_id=74338 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Vitalije Milosevic (vitalije) Assigned to: Oleg Broytmann (phd) Summary: sqlite URI is not handled right on windows Initial Comment: On Windows machine when I try to connect to some sqlite database file, I am receiving error message that says it was not possible to create (or open) file. I was inspecting code and found that path which is parsed from given URI starts with '/', and on Windows no valid path starts with '/'. I send in attachment new version of sqliteconnection.py with three lines which on windows platform strips unwanted '/' from the left of path. ---------------------------------------------------------------------- >Comment By: Vitalije Milosevic (vitalije) Date: 2008-03-03 14:47 Message: Logged In: YES user_id=2023531 Originator: YES Thank you for explanation that '/' is root of the current disk. I didn't know that so I have tried all kinds of paths that were including disk name. Still, it seems to me that it is impossible to make connection to the file that exists on some other disk. Neither it is possible to make connection to the file given by its relative path. Ok, I know it is possible to find absolute path from relative one, than strip disk part of absolute path, but it seems too complicated. Anyway, thank you for your response. ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2008-03-03 14:05 Message: Logged In: YES user_id=4799 Originator: NO What DB URI causes a problem for you? PS. On Windows there are valid paths that start with '/' because / is the root of the current disk. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1904948&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2008-03-03 13:28:52
|
Bugs item #1901446, was opened at 2008-02-25 18:29 Message generated for change (Comment added) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1901446&group_id=74338 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Postgres Group: SQLObject release (specify) >Status: Closed >Resolution: Accepted Priority: 5 Private: No Submitted By: Étienne Loks (nimn) >Assigned to: Oleg Broytmann (phd) Summary: Point type is considered as int Initial Comment: When using automatic class generation on a table with point fields, theses fields are considered as integer. As attachement a quick and dirty patch for SQLOBject 0.9.1 where point fields are considered as StringCol. ---------------------------------------------------------------------- >Comment By: Oleg Broytmann (phd) Date: 2008-03-03 16:28 Message: Logged In: YES user_id=4799 Originator: NO The patch is applied and committed in the revisions 3278-3280 (the branches 0.9, 0.10 and the trunk). Thank you! ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1901446&group_id=74338 |
|
From: <sub...@co...> - 2008-03-03 13:28:20
|
Author: phd
Date: 2008-03-03 06:28:10 -0700 (Mon, 03 Mar 2008)
New Revision: 3280
Modified:
SQLObject/trunk/docs/News.txt
SQLObject/trunk/sqlobject/postgres/pgconnection.py
Log:
Recognize POINT data type as string in PostgresConnection.columnsFromSchema().
Modified: SQLObject/trunk/docs/News.txt
===================================================================
--- SQLObject/trunk/docs/News.txt 2008-03-03 13:27:35 UTC (rev 3279)
+++ SQLObject/trunk/docs/News.txt 2008-03-03 13:28:10 UTC (rev 3280)
@@ -88,6 +88,8 @@
* Fixed a bug with no default when defaultSQL is defined for the column.
+* Recognize POINT data type as string in PostgresConnection.columnsFromSchema().
+
SQLObject 0.9.3
===============
Modified: SQLObject/trunk/sqlobject/postgres/pgconnection.py
===================================================================
--- SQLObject/trunk/sqlobject/postgres/pgconnection.py 2008-03-03 13:27:35 UTC (rev 3279)
+++ SQLObject/trunk/sqlobject/postgres/pgconnection.py 2008-03-03 13:28:10 UTC (rev 3280)
@@ -256,7 +256,9 @@
return results
def guessClass(self, t):
- if t.count('int'):
+ if t.count('point'): # poINT before INT
+ return col.StringCol, {}
+ elif t.count('int'):
return col.IntCol, {}
elif t.count('varying') or t.count('varchar'):
if '(' in t:
|
|
From: <sub...@co...> - 2008-03-03 13:27:40
|
Author: phd
Date: 2008-03-03 06:27:35 -0700 (Mon, 03 Mar 2008)
New Revision: 3279
Modified:
SQLObject/branches/0.10/docs/News.txt
SQLObject/branches/0.10/sqlobject/postgres/pgconnection.py
Log:
Recognize POINT data type as string in PostgresConnection.columnsFromSchema().
Modified: SQLObject/branches/0.10/docs/News.txt
===================================================================
--- SQLObject/branches/0.10/docs/News.txt 2008-03-03 13:26:43 UTC (rev 3278)
+++ SQLObject/branches/0.10/docs/News.txt 2008-03-03 13:27:35 UTC (rev 3279)
@@ -82,6 +82,8 @@
* Fixed a bug with no default when defaultSQL is defined for the column.
+* Recognize POINT data type as string in PostgresConnection.columnsFromSchema().
+
SQLObject 0.9.3
===============
Modified: SQLObject/branches/0.10/sqlobject/postgres/pgconnection.py
===================================================================
--- SQLObject/branches/0.10/sqlobject/postgres/pgconnection.py 2008-03-03 13:26:43 UTC (rev 3278)
+++ SQLObject/branches/0.10/sqlobject/postgres/pgconnection.py 2008-03-03 13:27:35 UTC (rev 3279)
@@ -256,7 +256,9 @@
return results
def guessClass(self, t):
- if t.count('int'):
+ if t.count('point'): # poINT before INT
+ return col.StringCol, {}
+ elif t.count('int'):
return col.IntCol, {}
elif t.count('varying') or t.count('varchar'):
if '(' in t:
|
|
From: <sub...@co...> - 2008-03-03 13:27:03
|
Author: phd
Date: 2008-03-03 06:26:43 -0700 (Mon, 03 Mar 2008)
New Revision: 3278
Modified:
SQLObject/branches/0.9/docs/News.txt
SQLObject/branches/0.9/sqlobject/postgres/pgconnection.py
Log:
Recognize POINT data type as string in PostgresConnection.columnsFromSchema().
Modified: SQLObject/branches/0.9/docs/News.txt
===================================================================
--- SQLObject/branches/0.9/docs/News.txt 2008-02-28 14:20:05 UTC (rev 3277)
+++ SQLObject/branches/0.9/docs/News.txt 2008-03-03 13:26:43 UTC (rev 3278)
@@ -17,6 +17,8 @@
* Fixed a bug with no default when defaultSQL is defined for the column.
+* Recognize POINT data type as string in PostgresConnection.columnsFromSchema().
+
SQLObject 0.9.3
===============
Modified: SQLObject/branches/0.9/sqlobject/postgres/pgconnection.py
===================================================================
--- SQLObject/branches/0.9/sqlobject/postgres/pgconnection.py 2008-02-28 14:20:05 UTC (rev 3277)
+++ SQLObject/branches/0.9/sqlobject/postgres/pgconnection.py 2008-03-03 13:26:43 UTC (rev 3278)
@@ -255,7 +255,9 @@
return results
def guessClass(self, t):
- if t.count('int'):
+ if t.count('point'): # poINT before INT
+ return col.StringCol, {}
+ elif t.count('int'):
return col.IntCol, {}
elif t.count('varying') or t.count('varchar'):
if '(' in t:
|
|
From: SourceForge.net <no...@so...> - 2008-03-03 13:19:56
|
Patches item #1673015, was opened at 2007-03-03 17:26 Message generated for change (Comment added) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1673015&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 Private: No Submitted By: Leandro Lucarella (llucax) Assigned to: Oleg Broytmann (phd) Summary: Use sets instead of dicts for used tables. Initial Comment: Since dicts are used as plain sets there, why not to just use sets? Yeah, I know, because of Python 2.2 compatibility :) Maybe some day... ---------------------------------------------------------------------- >Comment By: Oleg Broytmann (phd) Date: 2008-03-03 16:19 Message: Logged In: YES user_id=4799 Originator: NO Please recreate the patch against the 0.10 branch: tablesUsedDict() has an additional parameter 'db'. ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2007-03-27 18:21 Message: Logged In: YES user_id=4799 Originator: NO Will be applied after SQLObject would have switched to Python 2.3. ---------------------------------------------------------------------- Comment By: Leandro Lucarella (llucax) Date: 2007-03-03 17:27 Message: Logged In: YES user_id=240225 Originator: YES File Added: tablesdict.str.set-trunk.patch ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1673015&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2008-03-03 13:16:11
|
Patches item #1660094, was opened at 2007-02-15 01:02 Message generated for change (Comment added) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1660094&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: Accepted Priority: 5 Private: No Submitted By: Luke Opperman (lukeopperman) Assigned to: Nobody/Anonymous (nobody) Summary: Internal SQLBuilder use / ViewSQLObject Initial Comment: Ok, first-look patch for the discussion at http://comments.gmane.org/gmane.comp.python.sqlobject/7819 This was originally entered in Trac but it is currently down - this SF patch should supersede Trac #291. This also is an alternate resolution to SF Patch 1432078, "Add DISTINCT to sqlbuilder.py Select". This includes changes to Aliases and SQLJoins to properly handle sqlrepr'ing Alias(Select()) instances (and more generally, use sqlrepr to construct the join sqlrepr). But see item #2 below. All tests pass for me on postgres except where noted in the diff. This patch is probably NOT ready to be applied for the following hack-ish reasons: 1. sqlbuilder.Select LIMIT/OFFSET for db-specific formats - this was previously implemented in dbconnection-specific method "_queryAddLimitOffset" (only postgres and mysql override this today), should probably instead become a SQLExpression with a custom converter that implements these differences. 2. There's a fundamental issue with the current sqlbuilder.SQLExpression, where in several instances (AliasField.tablesUsedImmediate for instance) objects that may be SQLExpression instances are indiscriminately converted to strings, ie "%s %s %s % (self.tableName self.as_string, self.alias) when self.tableName is actually a Select instance. SQLExpression.__str__ calls .__sqlrepr__(None), which means that earlier than necessary we've lost the ability to format queries for the db they eventually run on (in the exposing case for me, I have Select(... clause=X.q.boolCol==True) and True is not properly formatted for the db. My recommendation for fixing #2 is to change these str-casts to sqlrepr(x, db), which will require tablesUsedImmediate accepting a db argument. This patch takes a lazier approach that lets me move forward, creating a module-level variable to override the None used in the __str__/__repr__ call mentioned above. ---------------------------------------------------------------------- >Comment By: Oleg Broytmann (phd) Date: 2008-03-03 16:16 Message: Logged In: YES user_id=4799 Originator: NO Luke Opperman implemented all this in SQLObject 0.10. ---------------------------------------------------------------------- Comment By: Luke Opperman (lukeopperman) Date: 2007-02-20 05:33 Message: Logged In: YES user_id=700949 Originator: YES File Added: sresults-views-20070219-2.diff ---------------------------------------------------------------------- Comment By: Luke Opperman (lukeopperman) Date: 2007-02-20 05:32 Message: Logged In: YES user_id=700949 Originator: YES File Added: sresults-selectOne-20060217.diff ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1660094&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2008-03-03 13:13:25
|
Bugs item #1904776, was opened at 2008-02-29 19:02 Message generated for change (Comment added) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1904776&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: SQLite Group: SQLObject from repository >Status: Closed >Resolution: Duplicate Priority: 5 Private: No Submitted By: Vitalije Milosevic (vitalije) Assigned to: Nobody/Anonymous (nobody) Summary: sqlite URI is not handled right on windows Initial Comment: On Windows machine when I try to connect to some sqlite database file, I am receiving error message that says it was not possible to create (or open) file. I was inspecting code and found that path which is parsed from given URI starts with '/', and on Windows no valid path starts with '/'. I send in attachment new version of sqliteconnection.py with three lines which on windows platform strips unwanted '/' from the left of path. ---------------------------------------------------------------------- >Comment By: Oleg Broytmann (phd) Date: 2008-03-03 16:13 Message: Logged In: YES user_id=4799 Originator: NO A dup of 1904948. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1904776&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2008-03-03 13:05:40
|
Patches item #1904948, was opened at 2008-02-29 23:46 Message generated for change (Comment added) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1904948&group_id=74338 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Vitalije Milosevic (vitalije) >Assigned to: Oleg Broytmann (phd) Summary: sqlite URI is not handled right on windows Initial Comment: On Windows machine when I try to connect to some sqlite database file, I am receiving error message that says it was not possible to create (or open) file. I was inspecting code and found that path which is parsed from given URI starts with '/', and on Windows no valid path starts with '/'. I send in attachment new version of sqliteconnection.py with three lines which on windows platform strips unwanted '/' from the left of path. ---------------------------------------------------------------------- >Comment By: Oleg Broytmann (phd) Date: 2008-03-03 16:05 Message: Logged In: YES user_id=4799 Originator: NO What DB URI causes a problem for you? PS. On Windows there are valid paths that start with '/' because / is the root of the current disk. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1904948&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2008-03-03 13:02:34
|
Patches item #1904874, was opened at 2008-02-29 21:15 Message generated for change (Settings changed) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1904874&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: Nobody/Anonymous (nobody) >Assigned to: Oleg Broytmann (phd) Summary: connectionForURI fails for mssql on Cygwin Initial Comment: when running connectionForURI on connection_string='mssql://user:password@host:port/database' the pymssql.connect is called with "host" (port is stripped) however, the called _mssql.connect() (pymssql:line 329) doesn't work unless the port is also specified. Here's the trace: Traceback (most recent call last): File "<stdin>", line 28, in <module> File "/usr/lib/python2.5/site-packages/SQLObject-0.10.0b3-py2.5.egg/sqlobject/main.py", line 880, in get val._init(id, connection, selectResults) File "/usr/lib/python2.5/site-packages/SQLObject-0.10.0b3-py2.5.egg/sqlobject/main.py", line 919, in _init selectResults = self._connection._SO_selectOne(self, dbNames) File "/usr/lib/python2.5/site-packages/SQLObject-0.10.0b3-py2.5.egg/sqlobject/dbconnection.py", line 514, in _SO_selectOne return self._SO_selectOneAlt(so, columnNames, so.q.id==so.id) File "/usr/lib/python2.5/site-packages/SQLObject-0.10.0b3-py2.5.egg/sqlobject/dbconnection.py", line 524, in _SO_selectOneAlt clause=condition))) File "/usr/lib/python2.5/site-packages/SQLObject-0.10.0b3-py2.5.egg/sqlobject/dbconnection.py", line 380, in queryOne return self._runWithConnection(self._queryOne, s) File "/usr/lib/python2.5/site-packages/SQLObject-0.10.0b3-py2.5.egg/sqlobject/dbconnection.py", line 248, in _runWithConnection conn = self.getConnection() File "/usr/lib/python2.5/site-packages/SQLObject-0.10.0b3-py2.5.egg/sqlobject/dbconnection.py", line 259, in getConnection conn = self.makeConnection() File "/usr/lib/python2.5/site-packages/SQLObject-0.10.0b3-py2.5.egg/sqlobject/mssql/mssqlconnection.py", line 83, in makeConnection con = self.dbconnection( *self.make_conn_str(self) ) File "/usr/lib/python2.5/site-packages/pymssql.py", line 328, in connect con = _mssql.connect(dbhost, dbuser, dbpasswd) _mssql.error: DB-Lib error message 20009, severity 9: Server is unavailable or does not exist. my quick correction replaces con = _mssql.connect(dbhost, dbuser, dbpasswd) to con = _mssql.connect(dbhost+":1433", dbuser, dbpasswd) Thank you. ---------------------------------------------------------------------- >Comment By: Oleg Broytmann (phd) Date: 2008-03-03 16:02 Message: Logged In: YES user_id=4799 Originator: NO You've patched pymssql which is not a part of SQLObject. I think you should report the problem to pymssql authors, no? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1904874&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2008-02-29 20:46:25
|
Patches item #1904948, was opened at 2008-02-29 21:46 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=1904948&group_id=74338 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Vitalije Milosevic (vitalije) Assigned to: Nobody/Anonymous (nobody) Summary: sqlite URI is not handled right on windows Initial Comment: On Windows machine when I try to connect to some sqlite database file, I am receiving error message that says it was not possible to create (or open) file. I was inspecting code and found that path which is parsed from given URI starts with '/', and on Windows no valid path starts with '/'. I send in attachment new version of sqliteconnection.py with three lines which on windows platform strips unwanted '/' from the left of path. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1904948&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2008-02-29 18:15:45
|
Patches item #1904874, was opened at 2008-02-29 10:15 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=1904874&group_id=74338 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: connectionForURI fails for mssql on Cygwin Initial Comment: when running connectionForURI on connection_string='mssql://user:password@host:port/database' the pymssql.connect is called with "host" (port is stripped) however, the called _mssql.connect() (pymssql:line 329) doesn't work unless the port is also specified. Here's the trace: Traceback (most recent call last): File "<stdin>", line 28, in <module> File "/usr/lib/python2.5/site-packages/SQLObject-0.10.0b3-py2.5.egg/sqlobject/main.py", line 880, in get val._init(id, connection, selectResults) File "/usr/lib/python2.5/site-packages/SQLObject-0.10.0b3-py2.5.egg/sqlobject/main.py", line 919, in _init selectResults = self._connection._SO_selectOne(self, dbNames) File "/usr/lib/python2.5/site-packages/SQLObject-0.10.0b3-py2.5.egg/sqlobject/dbconnection.py", line 514, in _SO_selectOne return self._SO_selectOneAlt(so, columnNames, so.q.id==so.id) File "/usr/lib/python2.5/site-packages/SQLObject-0.10.0b3-py2.5.egg/sqlobject/dbconnection.py", line 524, in _SO_selectOneAlt clause=condition))) File "/usr/lib/python2.5/site-packages/SQLObject-0.10.0b3-py2.5.egg/sqlobject/dbconnection.py", line 380, in queryOne return self._runWithConnection(self._queryOne, s) File "/usr/lib/python2.5/site-packages/SQLObject-0.10.0b3-py2.5.egg/sqlobject/dbconnection.py", line 248, in _runWithConnection conn = self.getConnection() File "/usr/lib/python2.5/site-packages/SQLObject-0.10.0b3-py2.5.egg/sqlobject/dbconnection.py", line 259, in getConnection conn = self.makeConnection() File "/usr/lib/python2.5/site-packages/SQLObject-0.10.0b3-py2.5.egg/sqlobject/mssql/mssqlconnection.py", line 83, in makeConnection con = self.dbconnection( *self.make_conn_str(self) ) File "/usr/lib/python2.5/site-packages/pymssql.py", line 328, in connect con = _mssql.connect(dbhost, dbuser, dbpasswd) _mssql.error: DB-Lib error message 20009, severity 9: Server is unavailable or does not exist. my quick correction replaces con = _mssql.connect(dbhost, dbuser, dbpasswd) to con = _mssql.connect(dbhost+":1433", dbuser, dbpasswd) Thank you. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1904874&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2008-02-29 16:02:56
|
Bugs item #1904776, was opened at 2008-02-29 17:02 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=1904776&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: SQLite Group: SQLObject from repository Status: Open Resolution: None Priority: 5 Private: No Submitted By: Vitalije Milosevic (vitalije) Assigned to: Nobody/Anonymous (nobody) Summary: sqlite URI is not handled right on windows Initial Comment: On Windows machine when I try to connect to some sqlite database file, I am receiving error message that says it was not possible to create (or open) file. I was inspecting code and found that path which is parsed from given URI starts with '/', and on Windows no valid path starts with '/'. I send in attachment new version of sqliteconnection.py with three lines which on windows platform strips unwanted '/' from the left of path. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1904776&group_id=74338 |
|
From: <sub...@co...> - 2008-02-28 14:20:14
|
Author: phd
Date: 2008-02-28 07:20:05 -0700 (Thu, 28 Feb 2008)
New Revision: 3277
Modified:
SQLObject/trunk/docs/News.txt
SQLObject/trunk/sqlobject/main.py
SQLObject/trunk/sqlobject/tests/test_basic.py
Log:
Fixed a bug with no default when defaultSQL is defined for the column.
Modified: SQLObject/trunk/docs/News.txt
===================================================================
--- SQLObject/trunk/docs/News.txt 2008-02-28 14:19:53 UTC (rev 3276)
+++ SQLObject/trunk/docs/News.txt 2008-02-28 14:20:05 UTC (rev 3277)
@@ -86,6 +86,8 @@
* Prevent MultipleJoin from removing the intermediate table if it was not
created by the Join.
+* Fixed a bug with no default when defaultSQL is defined for the column.
+
SQLObject 0.9.3
===============
Modified: SQLObject/trunk/sqlobject/main.py
===================================================================
--- SQLObject/trunk/sqlobject/main.py 2008-02-28 14:19:53 UTC (rev 3276)
+++ SQLObject/trunk/sqlobject/main.py 2008-02-28 14:20:05 UTC (rev 3277)
@@ -1199,8 +1199,14 @@
# If we don't get it, it's an error:
# If we specified an SQL DEFAULT, then we should use that
- if default is NoDefault and column.defaultSQL is not None:
- raise TypeError, "%s() did not get expected keyword argument %s" % (self.__class__.__name__, column.name)
+ if default is NoDefault:
+ if column.defaultSQL is None:
+ raise TypeError, "%s() did not get expected keyword argument '%s'" % (self.__class__.__name__, column.name)
+ else:
+ # There is defaultSQL for the column - do not put
+ # the column to kw so that the backend creates the value
+ continue
+
# Otherwise we put it in as though they did pass
# that keyword:
Modified: SQLObject/trunk/sqlobject/tests/test_basic.py
===================================================================
--- SQLObject/trunk/sqlobject/tests/test_basic.py 2008-02-28 14:19:53 UTC (rev 3276)
+++ SQLObject/trunk/sqlobject/tests/test_basic.py 2008-02-28 14:20:05 UTC (rev 3277)
@@ -302,3 +302,12 @@
def test_sqlmeta_inherited_idName():
setupClass(TestSO12)
assert TestSO12.sqlmeta.idName == "my_id"
+
+class TestSO13(SQLObject):
+ name = StringCol()
+ value = IntCol(defaultSQL='1')
+
+def test_defaultSQL():
+ setupClass(TestSO13)
+ test = TestSO13(name="test")
+ assert test.value == 1
|
|
From: <sub...@co...> - 2008-02-28 14:19:59
|
Author: phd
Date: 2008-02-28 07:19:53 -0700 (Thu, 28 Feb 2008)
New Revision: 3276
Modified:
SQLObject/branches/0.10/docs/News.txt
SQLObject/branches/0.10/sqlobject/main.py
SQLObject/branches/0.10/sqlobject/tests/test_basic.py
Log:
Fixed a bug with no default when defaultSQL is defined for the column.
Modified: SQLObject/branches/0.10/docs/News.txt
===================================================================
--- SQLObject/branches/0.10/docs/News.txt 2008-02-28 14:19:31 UTC (rev 3275)
+++ SQLObject/branches/0.10/docs/News.txt 2008-02-28 14:19:53 UTC (rev 3276)
@@ -80,6 +80,8 @@
* Prevent MultipleJoin from removing the intermediate table if it was not
created by the Join.
+* Fixed a bug with no default when defaultSQL is defined for the column.
+
SQLObject 0.9.3
===============
Modified: SQLObject/branches/0.10/sqlobject/main.py
===================================================================
--- SQLObject/branches/0.10/sqlobject/main.py 2008-02-28 14:19:31 UTC (rev 3275)
+++ SQLObject/branches/0.10/sqlobject/main.py 2008-02-28 14:19:53 UTC (rev 3276)
@@ -1199,8 +1199,14 @@
# If we don't get it, it's an error:
# If we specified an SQL DEFAULT, then we should use that
- if default is NoDefault and column.defaultSQL is not None:
- raise TypeError, "%s() did not get expected keyword argument %s" % (self.__class__.__name__, column.name)
+ if default is NoDefault:
+ if column.defaultSQL is None:
+ raise TypeError, "%s() did not get expected keyword argument '%s'" % (self.__class__.__name__, column.name)
+ else:
+ # There is defaultSQL for the column - do not put
+ # the column to kw so that the backend creates the value
+ continue
+
# Otherwise we put it in as though they did pass
# that keyword:
Modified: SQLObject/branches/0.10/sqlobject/tests/test_basic.py
===================================================================
--- SQLObject/branches/0.10/sqlobject/tests/test_basic.py 2008-02-28 14:19:31 UTC (rev 3275)
+++ SQLObject/branches/0.10/sqlobject/tests/test_basic.py 2008-02-28 14:19:53 UTC (rev 3276)
@@ -302,3 +302,12 @@
def test_sqlmeta_inherited_idName():
setupClass(TestSO12)
assert TestSO12.sqlmeta.idName == "my_id"
+
+class TestSO13(SQLObject):
+ name = StringCol()
+ value = IntCol(defaultSQL='1')
+
+def test_defaultSQL():
+ setupClass(TestSO13)
+ test = TestSO13(name="test")
+ assert test.value == 1
|
|
From: <sub...@co...> - 2008-02-28 14:19:38
|
Author: phd
Date: 2008-02-28 07:19:31 -0700 (Thu, 28 Feb 2008)
New Revision: 3275
Modified:
SQLObject/branches/0.9/docs/News.txt
SQLObject/branches/0.9/sqlobject/main.py
SQLObject/branches/0.9/sqlobject/tests/test_basic.py
Log:
Fixed a bug with no default when defaultSQL is defined for the column.
Modified: SQLObject/branches/0.9/docs/News.txt
===================================================================
--- SQLObject/branches/0.9/docs/News.txt 2008-02-28 10:53:58 UTC (rev 3274)
+++ SQLObject/branches/0.9/docs/News.txt 2008-02-28 14:19:31 UTC (rev 3275)
@@ -15,6 +15,8 @@
* Prevent MultipleJoin from removing the intermediate table if it was not
created by the Join.
+* Fixed a bug with no default when defaultSQL is defined for the column.
+
SQLObject 0.9.3
===============
Modified: SQLObject/branches/0.9/sqlobject/main.py
===================================================================
--- SQLObject/branches/0.9/sqlobject/main.py 2008-02-28 10:53:58 UTC (rev 3274)
+++ SQLObject/branches/0.9/sqlobject/main.py 2008-02-28 14:19:31 UTC (rev 3275)
@@ -1228,8 +1228,14 @@
# If we don't get it, it's an error:
# If we specified an SQL DEFAULT, then we should use that
- if default is NoDefault and column.defaultSQL is not None:
- raise TypeError, "%s() did not get expected keyword argument %s" % (self.__class__.__name__, column.name)
+ if default is NoDefault:
+ if column.defaultSQL is None:
+ raise TypeError, "%s() did not get expected keyword argument '%s'" % (self.__class__.__name__, column.name)
+ else:
+ # There is defaultSQL for the column - do not put
+ # the column to kw so that the backend creates the value
+ continue
+
# Otherwise we put it in as though they did pass
# that keyword:
Modified: SQLObject/branches/0.9/sqlobject/tests/test_basic.py
===================================================================
--- SQLObject/branches/0.9/sqlobject/tests/test_basic.py 2008-02-28 10:53:58 UTC (rev 3274)
+++ SQLObject/branches/0.9/sqlobject/tests/test_basic.py 2008-02-28 14:19:31 UTC (rev 3275)
@@ -302,3 +302,12 @@
def test_sqlmeta_inherited_idName():
setupClass(TestSO12)
assert TestSO12.sqlmeta.idName == "my_id"
+
+class TestSO13(SQLObject):
+ name = StringCol()
+ value = IntCol(defaultSQL='1')
+
+def test_defaultSQL():
+ setupClass(TestSO13)
+ test = TestSO13(name="test")
+ assert test.value == 1
|
|
From: <sub...@co...> - 2008-02-28 10:54:03
|
Author: phd Date: 2008-02-28 03:53:58 -0700 (Thu, 28 Feb 2008) New Revision: 3274 Modified: SQLObject/trunk/docs/News.txt Log: SQLObject 0.9.0 was released 10 May 2007. Modified: SQLObject/trunk/docs/News.txt =================================================================== --- SQLObject/trunk/docs/News.txt 2008-02-28 10:52:59 UTC (rev 3273) +++ SQLObject/trunk/docs/News.txt 2008-02-28 10:53:58 UTC (rev 3274) @@ -122,6 +122,8 @@ SQLObject 0.9.0 =============== +Released 10 May 2007. + Features & Interface -------------------- |