sqlobject-cvs Mailing List for SQLObject (Page 186)
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
(9) |
Apr
(74) |
May
(29) |
Jun
(16) |
Jul
(28) |
Aug
(10) |
Sep
(57) |
Oct
(9) |
Nov
(29) |
Dec
(12) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(7) |
Feb
(14) |
Mar
(6) |
Apr
(3) |
May
(12) |
Jun
(34) |
Jul
(9) |
Aug
(29) |
Sep
(22) |
Oct
(2) |
Nov
(15) |
Dec
(52) |
2005 |
Jan
(47) |
Feb
(78) |
Mar
(14) |
Apr
(35) |
May
(33) |
Jun
(16) |
Jul
(26) |
Aug
(63) |
Sep
(40) |
Oct
(96) |
Nov
(96) |
Dec
(123) |
2006 |
Jan
(159) |
Feb
(144) |
Mar
(64) |
Apr
(31) |
May
(88) |
Jun
(48) |
Jul
(16) |
Aug
(64) |
Sep
(87) |
Oct
(92) |
Nov
(56) |
Dec
(76) |
2007 |
Jan
(94) |
Feb
(103) |
Mar
(126) |
Apr
(123) |
May
(85) |
Jun
(11) |
Jul
(130) |
Aug
(47) |
Sep
(65) |
Oct
(70) |
Nov
(12) |
Dec
(11) |
2008 |
Jan
(30) |
Feb
(55) |
Mar
(88) |
Apr
(20) |
May
(50) |
Jun
|
Jul
(38) |
Aug
(1) |
Sep
(9) |
Oct
(5) |
Nov
(6) |
Dec
(39) |
2009 |
Jan
(8) |
Feb
(16) |
Mar
(3) |
Apr
(33) |
May
(44) |
Jun
(1) |
Jul
(10) |
Aug
(33) |
Sep
(74) |
Oct
(22) |
Nov
|
Dec
(15) |
2010 |
Jan
(28) |
Feb
(22) |
Mar
(46) |
Apr
(29) |
May
(1) |
Jun
(1) |
Jul
(27) |
Aug
(8) |
Sep
(5) |
Oct
(33) |
Nov
(24) |
Dec
(41) |
2011 |
Jan
(4) |
Feb
(12) |
Mar
(35) |
Apr
(29) |
May
(19) |
Jun
(16) |
Jul
(32) |
Aug
(25) |
Sep
(5) |
Oct
(11) |
Nov
(21) |
Dec
(12) |
2012 |
Jan
(3) |
Feb
(4) |
Mar
(20) |
Apr
(4) |
May
(25) |
Jun
(13) |
Jul
|
Aug
|
Sep
(2) |
Oct
(25) |
Nov
(9) |
Dec
(1) |
2013 |
Jan
(6) |
Feb
(8) |
Mar
|
Apr
(10) |
May
(31) |
Jun
(7) |
Jul
(18) |
Aug
(33) |
Sep
(4) |
Oct
(16) |
Nov
|
Dec
(27) |
2014 |
Jan
(2) |
Feb
|
Mar
|
Apr
(11) |
May
(39) |
Jun
(8) |
Jul
(11) |
Aug
(4) |
Sep
|
Oct
(27) |
Nov
|
Dec
(71) |
2015 |
Jan
(17) |
Feb
(47) |
Mar
(33) |
Apr
|
May
|
Jun
(9) |
Jul
(7) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(8) |
2016 |
Jan
(4) |
Feb
(4) |
Mar
|
Apr
|
May
(12) |
Jun
(7) |
Jul
(9) |
Aug
(31) |
Sep
(8) |
Oct
(3) |
Nov
(15) |
Dec
(1) |
2017 |
Jan
(13) |
Feb
(7) |
Mar
(14) |
Apr
(8) |
May
(10) |
Jun
(4) |
Jul
(2) |
Aug
(1) |
Sep
|
Oct
(8) |
Nov
(4) |
Dec
(5) |
2018 |
Jan
(2) |
Feb
(8) |
Mar
|
Apr
(4) |
May
|
Jun
(6) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
2019 |
Jan
(1) |
Feb
(16) |
Mar
(1) |
Apr
(3) |
May
(5) |
Jun
(1) |
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
(1) |
Dec
(3) |
2020 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(1) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
(2) |
Nov
|
Dec
(2) |
2021 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(1) |
Dec
|
2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(6) |
Oct
(1) |
Nov
(1) |
Dec
(4) |
2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(3) |
Sep
(2) |
Oct
(2) |
Nov
(4) |
Dec
|
2024 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(9) |
2025 |
Jan
|
Feb
(4) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <ian...@us...> - 2003-08-01 01:31:51
|
Update of /cvsroot/sqlobject/SQLObject/SQLObject In directory sc8-pr-cvs1:/tmp/cvs-serv32270/SQLObject Modified Files: Converters.py Log Message: Make sqlRepr look for magic sqlRepr method Index: Converters.py =================================================================== RCS file: /cvsroot/sqlobject/SQLObject/SQLObject/Converters.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Converters.py 18 Jul 2003 03:15:50 -0000 1.1 --- Converters.py 1 Aug 2003 01:30:09 -0000 1.2 *************** *** 95,102 **** def sqlRepr(obj): ! converter = lookupConverter(obj) ! if converter is None: ! raise ValueError, "Unknown SQL builtin type: %s for %s" % \ ! (type(obj), repr(obj)) ! return converter(obj) --- 95,107 ---- def sqlRepr(obj): ! try: ! reprFunc = obj.sqlRepr ! except AttributeError: ! converter = lookupConverter(obj) ! if converter is None: ! raise ValueError, "Unknown SQL builtin type: %s for %s" % \ ! (type(obj), repr(obj)) ! return converter(obj) ! else: ! return reprFunc() |
From: <ian...@us...> - 2003-08-01 01:19:38
|
Update of /cvsroot/sqlobject/SQLObject/SQLObject In directory sc8-pr-cvs1:/tmp/cvs-serv30854/SQLObject Modified Files: SQLObject.py Log Message: Added test in addNeedSet so we won't re-set an already set class (which causes an error for obscure reasons). Index: SQLObject.py =================================================================== RCS file: /cvsroot/sqlobject/SQLObject/SQLObject/SQLObject.py,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** SQLObject.py 18 Jul 2003 03:15:50 -0000 1.49 --- SQLObject.py 1 Aug 2003 01:19:34 -0000 1.50 *************** *** 100,104 **** cls = findClass(setCls, registry=registry) if callable(getattr(obj, attr, None)): ! getattr(obj, attr)(cls) else: setattr(obj, attr, cls) --- 100,107 ---- cls = findClass(setCls, registry=registry) if callable(getattr(obj, attr, None)): ! if not isinstance(getattr(obj, attr), type): ! # Otherwise we got a class, which means we probably ! # already set this column. ! getattr(obj, attr)(cls) else: setattr(obj, attr, cls) |
From: <dre...@us...> - 2003-07-31 14:25:35
|
Update of /cvsroot/sqlobject/SQLObject/SQLObject In directory sc8-pr-cvs1:/tmp/cvs-serv27167/SQLObject Modified Files: SQLBuilder.py Log Message: More tests and converters for the SQLExpression-basec classes Index: SQLBuilder.py =================================================================== RCS file: /cvsroot/sqlobject/SQLObject/SQLObject/SQLBuilder.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** SQLBuilder.py 30 Jul 2003 21:07:45 -0000 1.9 --- SQLBuilder.py 31 Jul 2003 14:25:32 -0000 1.10 *************** *** 242,245 **** --- 242,247 ---- execute(self.expr2, executor)) + registerConverter(SQLOp, SQLExprConverter) + class SQLCall(SQLExpression): def __init__(self, expr, args): *************** *** 253,256 **** --- 255,260 ---- raise ValueError, "I don't yet know how to locally execute functions" + registerConverter(SQLCall, SQLExprConverter) + class SQLPrefix(SQLExpression): def __init__(self, prefix, expr): *************** *** 270,273 **** --- 274,279 ---- return not expr + registerConverter(SQLPrefix, SQLExprConverter) + class SQLConstant(SQLExpression): def __init__(self, const): *************** *** 278,281 **** --- 284,289 ---- raise ValueError, "I don't yet know how to execute SQL constants" + registerConverter(SQLConstant, SQLExprConverter) + class SQLTrueClauseClass(SQLExpression): def sqlRepr(self): *************** *** 285,288 **** --- 293,298 ---- SQLTrueClause = SQLTrueClauseClass() + + registerConverter(SQLTrueClauseClass, SQLExprConverter) ######################################## |
From: <dre...@us...> - 2003-07-31 14:25:35
|
Update of /cvsroot/sqlobject/SQLObject/tests In directory sc8-pr-cvs1:/tmp/cvs-serv27167/tests Modified Files: test_converters.py Log Message: More tests and converters for the SQLExpression-basec classes Index: test_converters.py =================================================================== RCS file: /cvsroot/sqlobject/SQLObject/tests/test_converters.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test_converters.py 30 Jul 2003 21:07:45 -0000 1.2 --- test_converters.py 31 Jul 2003 14:25:33 -0000 1.3 *************** *** 2,6 **** from SQLObject.SQLBuilder import sqlRepr from SQLObject.SQLBuilder import SQLExpression, SQLObjectField, \ ! Select, Insert, Update, Delete, Replace from SQLObject.Converters import registerConverter --- 2,7 ---- from SQLObject.SQLBuilder import sqlRepr from SQLObject.SQLBuilder import SQLExpression, SQLObjectField, \ ! Select, Insert, Update, Delete, Replace, \ ! SQLTrueClauseClass, SQLConstant, SQLPrefix, SQLCall, SQLOp from SQLObject.Converters import registerConverter *************** *** 107,110 **** --- 108,131 ---- def test_replace(self): instance = Replace('test', {'test':'test'}) + self.assertEqual(sqlRepr(instance), repr(instance)) + + def test_trueclause(self): + instance = SQLTrueClauseClass() + self.assertEqual(sqlRepr(instance), repr(instance)) + + def test_op(self): + instance = SQLOp('and', 'this', 'that') + self.assertEqual(sqlRepr(instance), repr(instance)) + + def test_call(self): + instance = SQLCall('test', 'test') + self.assertEqual(sqlRepr(instance), repr(instance)) + + def test_constant(self): + instance = SQLConstant('test') + self.assertEqual(sqlRepr(instance), repr(instance)) + + def test_prefix(self): + instance = SQLPrefix('test', 'test') self.assertEqual(sqlRepr(instance), repr(instance)) |
From: <dre...@us...> - 2003-07-30 21:07:49
|
Update of /cvsroot/sqlobject/SQLObject/tests In directory sc8-pr-cvs1:/tmp/cvs-serv32150/tests Modified Files: test_converters.py Log Message: Fix the problem with the 'magic q' and add a few more tests. Also register a few more converters while we're at it. Index: test_converters.py =================================================================== RCS file: /cvsroot/sqlobject/SQLObject/tests/test_converters.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test_converters.py 18 Jul 2003 03:15:52 -0000 1.1 --- test_converters.py 30 Jul 2003 21:07:45 -0000 1.2 *************** *** 1,4 **** --- 1,6 ---- import unittest from SQLObject.SQLBuilder import sqlRepr + from SQLObject.SQLBuilder import SQLExpression, SQLObjectField, \ + Select, Insert, Update, Delete, Replace from SQLObject.Converters import registerConverter *************** *** 13,16 **** --- 15,35 ---- registerConverter(TestClass, TestClassConverter) + class NewTestClass: + + __metaclass__ = type + + def __repr__(self): + return '<NewTestClass>' + + def NewTestClassConverter(value): + return repr(value) + + registerConverter(NewTestClass, NewTestClassConverter) + + def _sqlRepr(self): + return '<%s>' % self.__class__.__name__ + + SQLExpression.sqlRepr = _sqlRepr + class ConvertersTest(unittest.TestCase): *************** *** 56,59 **** --- 75,110 ---- def test_instance(self): instance = TestClass() + self.assertEqual(sqlRepr(instance), repr(instance)) + + def test_newstyle(self): + instance = NewTestClass() + self.assertEqual(sqlRepr(instance), repr(instance)) + + def test_sqlexpr(self): + instance = SQLExpression() + self.assertEqual(sqlRepr(instance), repr(instance)) + + def test_sqlobjectfield(self): + instance = SQLObjectField('test', 'test', 'test') + self.assertEqual(sqlRepr(instance), repr(instance)) + + def test_select(self): + instance = Select('test') + self.assertEqual(sqlRepr(instance), repr(instance)) + + def test_insert(self): + instance = Insert('test', ('test',)) + self.assertEqual(sqlRepr(instance), repr(instance)) + + def test_update(self): + instance = Update('test', {'test':'test'}) + self.assertEqual(sqlRepr(instance), repr(instance)) + + def test_delete(self): + instance = Delete('test', None) + self.assertEqual(sqlRepr(instance), repr(instance)) + + def test_replace(self): + instance = Replace('test', {'test':'test'}) self.assertEqual(sqlRepr(instance), repr(instance)) |
From: <dre...@us...> - 2003-07-30 21:07:49
|
Update of /cvsroot/sqlobject/SQLObject/SQLObject In directory sc8-pr-cvs1:/tmp/cvs-serv32150/SQLObject Modified Files: SQLBuilder.py Log Message: Fix the problem with the 'magic q' and add a few more tests. Also register a few more converters while we're at it. Index: SQLBuilder.py =================================================================== RCS file: /cvsroot/sqlobject/SQLObject/SQLObject/SQLBuilder.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** SQLBuilder.py 18 Jul 2003 03:15:50 -0000 1.8 --- SQLBuilder.py 30 Jul 2003 21:07:45 -0000 1.9 *************** *** 334,337 **** --- 334,339 ---- Field.__init__(self, tableName, fieldName) + registerConverter(SQLObjectField, SQLExprConverter) + class ConstantSpace: def __getattr__(self, attr): *************** *** 381,384 **** --- 383,388 ---- return select + registerConverter(Select, SQLExprConverter) + class Insert(SQLExpression): def __init__(self, table, valueList=None, values=None, template=NoDefault): *************** *** 418,421 **** --- 422,427 ---- return insert + registerConverter(Insert, SQLExprConverter) + def dictToList(template, dict): list = [] *************** *** 456,459 **** --- 462,467 ---- return "UPDATE" + registerConverter(Update, SQLExprConverter) + class Delete(SQLExpression): """To be safe, this will signal an error if there is no where clause, *************** *** 470,476 **** --- 478,488 ---- % (self.table, sqlRepr(self.whereClause)) + registerConverter(Delete, SQLExprConverter) + class Replace(Update): def sqlName(self): return "REPLACE" + + registerConverter(Replace, SQLExprConverter) ######################################## |
From: <ian...@us...> - 2003-07-18 03:26:40
|
Update of /cvsroot/sqlobject/SQLObject In directory sc8-pr-cvs1:/tmp/cvs-serv19951 Modified Files: MANIFEST.in Log Message: More explicit about files to include in distributions Index: MANIFEST.in =================================================================== RCS file: /cvsroot/sqlobject/SQLObject/MANIFEST.in,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MANIFEST.in 13 Mar 2003 20:56:39 -0000 1.2 --- MANIFEST.in 18 Jul 2003 03:26:31 -0000 1.3 *************** *** 2,6 **** include *.html include *.css ! recursive-include examples *.txt *.py ! recursive-include docs *.txt *.html *.css recursive-include tests *.py --- 2,8 ---- include *.html include *.css ! include examples/*.py ! include docs/*.txt ! include docs/*.html ! include docs/*.css recursive-include tests *.py |
From: <dre...@us...> - 2003-07-18 03:15:58
|
Update of /cvsroot/sqlobject/SQLObject/SQLObject In directory sc8-pr-cvs1:/tmp/cvs-serv18491/SQLObject Modified Files: DBConnection.py SQLBuilder.py SQLObject.py Added Files: Converters.py Log Message: Refactored sqlRepr function into a separate module and added some tests. Also, some whitespace cleaning as I go visiting files. --- NEW FILE: Converters.py --- try: import mx.DateTime.ISO origISOStr = mx.DateTime.ISO.strGMT from mx.DateTime import DateTimeType except ImportError: try: import DateTime.ISO origISOStr = DateTime.ISO.strGMT from DateTime import DateTimeType except ImportError: origISOStr = None DateTimeType = None from types import InstanceType, ClassType, TypeType ######################################## ## Quoting ######################################## sqlStringReplace = [ ('\\', '\\\\'), ('\'', '\\\''), ('\000', '\\0'), ('\b', '\\b'), ('\n', '\\n'), ('\r', '\\r'), ('\t', '\\t'), ] def isoStr(val): """Gets rid of time zone information""" val = origISOStr(val) if val.find('+') == -1: return val else: return val[:val.find('+')] class ConverterRegistry: def __init__(self): self.basic = {} self.klass = {} def registerConverter(self, typ, func): if type(typ) is ClassType: self.klass[typ] = func else: self.basic[typ] = func def lookupConverter(self, value, default=None): if type(value) == InstanceType: # lookup on klasses dict return self.klass.get(value.__class__, default) return self.basic.get(type(value), default) converters = ConverterRegistry() registerConverter = converters.registerConverter lookupConverter = converters.lookupConverter def StringLikeConverter(value): for orig, repl in sqlStringReplace: value = value.replace(orig, repl) return "'%s'" % value registerConverter(type(""), StringLikeConverter) registerConverter(type(u""), StringLikeConverter) def IntConverter(value): return repr(int(value)) registerConverter(type(1), IntConverter) registerConverter(type(0L), IntConverter) def FloatConverter(value): return repr(value) registerConverter(type(1.0), FloatConverter) if DateTimeType: def DateTimeConverter(value): return "'%s'" % isoStr(value) registerConverter(DateTimeType, DateTimeConverter) def NoneConverter(value): return "NULL" registerConverter(type(None), NoneConverter) def SequenceConverter(value): return "(%s)" % ", ".join(map(sqlRepr, value)) registerConverter(type(()), SequenceConverter) registerConverter(type([]), SequenceConverter) def sqlRepr(obj): converter = lookupConverter(obj) if converter is None: raise ValueError, "Unknown SQL builtin type: %s for %s" % \ (type(obj), repr(obj)) return converter(obj) Index: DBConnection.py =================================================================== RCS file: /cvsroot/sqlobject/SQLObject/SQLObject/DBConnection.py,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** DBConnection.py 15 Jul 2003 02:27:19 -0000 1.40 --- DBConnection.py 18 Jul 2003 03:15:50 -0000 1.41 *************** *** 471,475 **** % (idName, table, c.lastoid())) return c.fetchone()[0] ! def _queryAddLimitOffset(self, query, start, end): if not start: --- 471,475 ---- % (idName, table, c.lastoid())) return c.fetchone()[0] ! def _queryAddLimitOffset(self, query, start, end): if not start: *************** *** 481,485 **** def createColumn(self, soClass, col): return col.postgresCreateSQL() ! def createIDColumn(self, soClass): return '%s SERIAL PRIMARY KEY' % soClass._idName --- 481,485 ---- def createColumn(self, soClass, col): return col.postgresCreateSQL() ! def createIDColumn(self, soClass): return '%s SERIAL PRIMARY KEY' % soClass._idName *************** *** 505,509 **** def columnsFromSchema(self, tableName, soClass): ! keyQuery = """ SELECT pg_catalog.pg_get_constraintdef(oid) as condef --- 505,509 ---- def columnsFromSchema(self, tableName, soClass): ! keyQuery = """ SELECT pg_catalog.pg_get_constraintdef(oid) as condef *************** *** 568,572 **** # Pooling doesn't work with transactions... kw['pool'] = 0 ! # use only one connection for sqlite - supports multiple # cursors per connection self._conn = sqlite.connect(self.filename) --- 568,572 ---- # Pooling doesn't work with transactions... kw['pool'] = 0 ! # use only one connection for sqlite - supports multiple # cursors per connection self._conn = sqlite.connect(self.filename) *************** *** 627,631 **** * ``_SO_createJoinTable(join)`` """ ! def queryInsertID(self, table, idName, names, values): id = self._newID(table) --- 627,631 ---- * ``_SO_createJoinTable(join)`` """ ! def queryInsertID(self, table, idName, names, values): id = self._newID(table) *************** *** 819,823 **** else: db[join2 + str(id2)] = str(id1) ! def _SO_intermediateDelete(self, table, join1, id1, join2, id2): db = self._openTable(table) --- 819,823 ---- else: db[join2 + str(id2)] = str(id1) ! def _SO_intermediateDelete(self, table, join1, id1, join2, id2): db = self._openTable(table) *************** *** 877,881 **** except IndexError: raise StopIteration ! for idList in self.comboIter: self.idList = idList --- 877,881 ---- except IndexError: raise StopIteration ! for idList in self.comboIter: self.idList = idList *************** *** 897,901 **** except StopIteration: return results ! def _iterAllCombinations(l): --- 897,901 ---- except StopIteration: return results ! def _iterAllCombinations(l): Index: SQLBuilder.py =================================================================== RCS file: /cvsroot/sqlobject/SQLObject/SQLObject/SQLBuilder.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** SQLBuilder.py 5 Jul 2003 03:49:52 -0000 1.7 --- SQLBuilder.py 18 Jul 2003 03:15:50 -0000 1.8 *************** *** 68,129 **** True, False = (1==1), (0==1) - ######################################## - ## Quoting - ######################################## - - sqlStringReplace = [ - ('\\', '\\\\'), - ('\'', '\\\''), - ('\000', '\\0'), - ('\b', '\\b'), - ('\n', '\\n'), - ('\r', '\\r'), - ('\t', '\\t'), - ] - - try: - import mx.DateTime.ISO - origISOStr = mx.DateTime.ISO.strGMT - from mx.DateTime import DateTimeType - except ImportError: - try: - import DateTime.ISO - origISOStr = DateTime.ISO.strGMT - from DateTime import DateTimeType - except ImportError: - origISOStr = None - DateTimeType = None import re, fnmatch import operator ! ! def isoStr(val): ! """Gets rid of time zone information""" ! val = origISOStr(val) ! if val.find('+') == -1: ! return val ! else: ! return val[:val.find('+')] ! ! def sqlRepr(obj): ! t = type(obj) ! if isinstance(obj, SQLExpression): ! return obj.sqlRepr() ! elif t is type("") or t is type(u""): ! for orig, repl in sqlStringReplace: ! obj = obj.replace(orig, repl) ! return "'%s'" % obj ! elif t is type(0L) or t is type(1): ! return repr(int(obj)) ! elif t is type(1.0): ! return repr(obj) ! elif DateTimeType and t is DateTimeType: ! return "'%s'" % isoStr(obj) ! elif obj is None: ! return "NULL" ! elif t is type(()) or t is type([]): ! return "(%s)" % ", ".join(map(sqlRepr, obj)) ! else: ! raise ValueError, "Unknown SQL builtin type: %s for %s" % \ ! (t, repr(obj)) safeSQLRE = re.compile(r'^[a-zA-Z][a-zA-Z0-9_\.]*$') --- 68,74 ---- True, False = (1==1), (0==1) import re, fnmatch import operator ! from Converters import sqlRepr, registerConverter safeSQLRE = re.compile(r'^[a-zA-Z][a-zA-Z0-9_\.]*$') *************** *** 237,240 **** --- 182,194 ---- return [] + ####################################### + # Converter for SQLExpression instances + ####################################### + + def SQLExprConverter(value): + return value.sqlRepr() + + registerConverter(SQLExpression, SQLExprConverter) + def tablesUsedDict(obj): if hasattr(obj, "tablesUsedDict"): *************** *** 414,418 **** if tables: select += " FROM %s" % ", ".join(tables) ! if self.whereClause is not NoDefault: select += " WHERE %s" % sqlRepr(self.whereClause) --- 368,372 ---- if tables: select += " FROM %s" % ", ".join(tables) ! if self.whereClause is not NoDefault: select += " WHERE %s" % sqlRepr(self.whereClause) Index: SQLObject.py =================================================================== RCS file: /cvsroot/sqlobject/SQLObject/SQLObject/SQLObject.py,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** SQLObject.py 17 Jul 2003 01:23:57 -0000 1.48 --- SQLObject.py 18 Jul 2003 03:15:50 -0000 1.49 *************** *** 76,80 **** newNeedList.append((needClass, setCls)) needSet[registryName] = newNeedList ! def setNeedSet(): global needSet --- 76,80 ---- newNeedList.append((needClass, setCls)) needSet[registryName] = newNeedList ! def setNeedSet(): global needSet *************** *** 117,121 **** def __new__(cls, className, bases, d): ! global classRegistry, needSet --- 117,121 ---- def __new__(cls, className, bases, d): ! global classRegistry, needSet *************** *** 496,500 **** setattr(cls, setterName(name)[:-2], setter) cls._SO_plainForeignSetters[name[:-2]] = 1 ! # We'll need to put in a real reference at # some point. See needSet at the top of the --- 496,500 ---- setattr(cls, setterName(name)[:-2], setter) cls._SO_plainForeignSetters[name[:-2]] = 1 ! # We'll need to put in a real reference at # some point. See needSet at the top of the *************** *** 570,574 **** meth = join.joinMethodName cls._SO_joinDict[joinDef] = join ! cls._SO_joinList.append(join) index = len(cls._SO_joinList)-1 --- 570,574 ---- meth = join.joinMethodName cls._SO_joinDict[joinDef] = join ! cls._SO_joinList.append(join) index = len(cls._SO_joinList)-1 *************** *** 664,669 **** raise SQLObjectNotFound, "The object %s by the ID %s does not exist" % (self.__class__.__name__, self.id) self._SO_selectInit(selectResults) ! ! def _SO_setValue(self, name, value): # This is the place where we actually update the --- 664,669 ---- raise SQLObjectNotFound, "The object %s by the ID %s does not exist" % (self.__class__.__name__, self.id) self._SO_selectInit(selectResults) ! ! def _SO_setValue(self, name, value): # This is the place where we actually update the *************** *** 681,688 **** [(self._SO_columnDict[name].dbName, value)]) ! if self._cacheValues: setattr(self, instanceName(name), value) ! def set(self, **kw): # set() is used to update multiple values at once, --- 681,688 ---- [(self._SO_columnDict[name].dbName, value)]) ! if self._cacheValues: setattr(self, instanceName(name), value) ! def set(self, **kw): # set() is used to update multiple values at once, *************** *** 693,697 **** self._SO_createValues.update(kw) return ! self._SO_writeLock.acquire() --- 693,697 ---- self._SO_createValues.update(kw) return ! self._SO_writeLock.acquire() *************** *** 730,734 **** assert results != None, "%s with id %s is not in the database" \ % (self.__class__.__name__, self.id) ! return results[0] def _SO_foreignKey(self, id, joinClass): --- 730,734 ---- assert results != None, "%s with id %s is not in the database" \ % (self.__class__.__name__, self.id) ! return results[0] def _SO_foreignKey(self, id, joinClass): *************** *** 756,760 **** # passed: for column in inst._SO_columns: ! # If a foreign key is given, we get the ID of the object # and put that in instead --- 756,760 ---- # passed: for column in inst._SO_columns: ! # If a foreign key is given, we get the ID of the object # and put that in instead *************** *** 813,817 **** del self._SO_createValues del self._SO_creating ! # Do the insert -- most of the SQL in this case is left # up to DBConnection, since getting a new ID is --- 813,817 ---- del self._SO_createValues del self._SO_creating ! # Do the insert -- most of the SQL in this case is left # up to DBConnection, since getting a new ID is *************** *** 831,835 **** [cls._idName] + [col.dbName for col in cls._SO_columns], ! dbIDName, value) if not result: --- 831,835 ---- [cls._idName] + [col.dbName for col in cls._SO_columns], ! dbIDName, value) if not result: *************** *** 915,919 **** cls._connection.clearTable(cls._table) clearTable = classmethod(clearTable) ! def destroySelf(self): # Kills this object. Kills it dead! --- 915,919 ---- cls._connection.clearTable(cls._table) clearTable = classmethod(clearTable) ! def destroySelf(self): # Kills this object. Kills it dead! *************** *** 925,929 **** obj = cls(id) obj.destroySelf() ! delete = classmethod(delete) --- 925,929 ---- obj = cls(id) obj.destroySelf() ! delete = classmethod(delete) *************** *** 958,962 **** def instanceName(name): return '_SO_val_%s' % name ! class SelectResults(object): --- 958,962 ---- def instanceName(name): return '_SO_val_%s' % name ! class SelectResults(object): *************** *** 1088,1093 **** count = min(self.ops['end'] - self.ops.get('start', 0), count) return count ! ! --- 1088,1093 ---- count = min(self.ops['end'] - self.ops.get('start', 0), count) return count ! ! |
From: <dre...@us...> - 2003-07-18 03:15:58
|
Update of /cvsroot/sqlobject/SQLObject/tests In directory sc8-pr-cvs1:/tmp/cvs-serv18491/tests Modified Files: test_cache.py Added Files: test_converters.py Log Message: Refactored sqlRepr function into a separate module and added some tests. Also, some whitespace cleaning as I go visiting files. --- NEW FILE: test_converters.py --- import unittest from SQLObject.SQLBuilder import sqlRepr from SQLObject.Converters import registerConverter class TestClass: def __repr__(self): return '<TestClass>' def TestClassConverter(value): return repr(value) registerConverter(TestClass, TestClassConverter) class ConvertersTest(unittest.TestCase): def test_simple_string(self): self.assertEqual(sqlRepr('A String'), "'A String'") def test_string_newline(self): self.assertEqual(sqlRepr('A String\nAnother'), "'A String\\nAnother'") def test_string_tab(self): self.assertEqual(sqlRepr('A String\tAnother'), "'A String\\tAnother'") def test_string_r(self): self.assertEqual(sqlRepr('A String\rAnother'), "'A String\\rAnother'") def test_string_b(self): self.assertEqual(sqlRepr('A String\bAnother'), "'A String\\bAnother'") def test_string_000(self): self.assertEqual(sqlRepr('A String\000Another'), "'A String\\0Another'") def test_string_(self): self.assertEqual(sqlRepr('A String\'Another'), "'A String\\\'Another'") def test_simple_unicode(self): self.assertEqual(sqlRepr(u'A String'), "'A String'") def test_integer(self): self.assertEqual(sqlRepr(10), "10") def test_float(self): self.assertEqual(sqlRepr(10.01), "10.01") def test_none(self): self.assertEqual(sqlRepr(None), "NULL") def test_list(self): self.assertEqual(sqlRepr(['one','two','three']), "('one', 'two', 'three')") def test_tuple(self): self.assertEqual(sqlRepr(('one','two','three')), "('one', 'two', 'three')") def test_instance(self): instance = TestClass() self.assertEqual(sqlRepr(instance), repr(instance)) if __name__ == "__main__": unittest.main() Index: test_cache.py =================================================================== RCS file: /cvsroot/sqlobject/SQLObject/tests/test_cache.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test_cache.py 17 Apr 2003 02:58:39 -0000 1.1 --- test_cache.py 18 Jul 2003 03:15:52 -0000 1.2 *************** *** 5,9 **** pass - class CacheTest(unittest.TestCase): --- 5,8 ---- *************** *** 24,28 **** self.assertEqual(j, None) x.finishPut(y.__class__) - if __name__ == "__main__": --- 23,26 ---- |
From: <ian...@us...> - 2003-07-17 01:24:00
|
Update of /cvsroot/sqlobject/SQLObject/SQLObject In directory sc8-pr-cvs1:/tmp/cvs-serv28706 Modified Files: SQLObject.py Log Message: Fixed up single-value __getitem__ access to SelectResults Index: SQLObject.py =================================================================== RCS file: /cvsroot/sqlobject/SQLObject/SQLObject/SQLObject.py,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** SQLObject.py 10 Jul 2003 19:16:07 -0000 1.47 --- SQLObject.py 17 Jul 2003 01:23:57 -0000 1.48 *************** *** 1033,1036 **** --- 1033,1040 ---- # No need to copy, I'm immutable return self + + # Negative indexes aren't handled (and everything we + # don't handle ourselves we just create a list to + # handle) if (value.start and value.start < 0) \ or (value.stop and value.stop < 0): *************** *** 1040,1049 **** return list(self)[value.start:] return list(self)[:value.stop] if value.start: ! assert value.start >= 0, "Negative index not supported (%s)" % value.start start = self.ops.get('start', 0) + value.start if value.stop is not None: ! assert value.stop >= 0, "Negative indexes not supported (%s)" % value.stop if value.stop < value.start: end = start else: --- 1044,1056 ---- return list(self)[value.start:] return list(self)[:value.stop] + + if value.start: ! assert value.start >= 0 start = self.ops.get('start', 0) + value.start if value.stop is not None: ! assert value.stop >= 0 if value.stop < value.start: + # an empty result: end = start else: *************** *** 1051,1054 **** --- 1058,1062 ---- if self.ops.get('end', None) is not None \ and value['end'] < end: + # truncated by previous slice: end = self.ops['end'] else: *************** *** 1065,1069 **** return list(iter(self))[value] else: ! return list(self.clone(start=value, stop=value+1))[0] def __iter__(self): --- 1073,1078 ---- return list(iter(self))[value] else: ! start = self.ops.get('start', 0) + value ! return list(self.clone(start=start, end=start+1))[0] def __iter__(self): |
From: <ian...@us...> - 2003-07-17 01:20:21
|
Update of /cvsroot/sqlobject/SQLObject/tests In directory sc8-pr-cvs1:/tmp/cvs-serv28189/tests Modified Files: test.py Log Message: Added iteration test Index: test.py =================================================================== RCS file: /cvsroot/sqlobject/SQLObject/tests/test.py,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** test.py 10 Jul 2003 19:25:47 -0000 1.20 --- test.py 17 Jul 2003 01:20:18 -0000 1.21 *************** *** 2,5 **** --- 2,6 ---- from SQLObject import * from mx import DateTime + from __future__ import generators ######################################## *************** *** 128,131 **** --- 129,197 ---- ('joe', 'robbins'), ('tim', 'jackson'), ('zoe', 'robbins')]) + + ######################################## + ## Select results + ######################################## + + class IterTest(SQLObject): + name = StringCol() + + class IterationTestCase(SQLObjectTest): + '''Test basic iteration techniques''' + + classes = [IterTest] + + names = ('a', 'b', 'c') + + def inserts(self): + for name in self.names: + IterTest.new(name=name) + + def test_00_normal(self): + count = 0 + for test in IterTest.select(): + count += 1 + self.failIf(count != len(self.names)) + + def test_01_turn_to_list(self): + count = 0 + for test in list(IterTest.select()): + count += 1 + self.failIf(count != len(self.names)) + + def test_02_generator(self): + def enumerate(iterable): + i = 0 + for obj in iterable: + yield i, obj + i += 1 + all = IterTest.select() + count = 0 + for i, test in enumerate(all): + count += 1 + self.failIf(count != len(self.names)) + + def test_03_ranged_indexed(self): + all = IterTest.select() + count = 0 + for i in range(len(all)): + test = all[i] + count += 1 + self.failIf(count != len(self.names)) + + def test_04_indexed_ended_by_exception(self): + all = IterTest.select() + count = 0 + try: + while 1: + test = all[count] + count = count+1 + # Stop the test if it's gone on too long + if count > len(self.names): + break + except IndexError: + pass + self.failIf(count != len(self.names)) + ######################################## |
From: <ian...@us...> - 2003-07-15 02:27:22
|
Update of /cvsroot/sqlobject/SQLObject/SQLObject In directory sc8-pr-cvs1:/tmp/cvs-serv19526 Modified Files: DBConnection.py Log Message: Fixed typo in guessClass Index: DBConnection.py =================================================================== RCS file: /cvsroot/sqlobject/SQLObject/SQLObject/DBConnection.py,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** DBConnection.py 10 Jul 2003 19:27:50 -0000 1.39 --- DBConnection.py 15 Jul 2003 02:27:19 -0000 1.40 *************** *** 433,437 **** return Col.DateTimeCol, {} else: ! return Col, {} --- 433,437 ---- return Col.DateTimeCol, {} else: ! return Col.Col, {} |
From: <ian...@us...> - 2003-07-15 02:25:33
|
Update of /cvsroot/sqlobject/SQLObject/SQLObject In directory sc8-pr-cvs1:/tmp/cvs-serv19276 Modified Files: Cache.py Log Message: typo in purge Index: Cache.py =================================================================== RCS file: /cvsroot/sqlobject/SQLObject/SQLObject/Cache.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Cache.py 5 May 2003 20:42:08 -0000 1.7 --- Cache.py 15 Jul 2003 02:25:31 -0000 1.8 *************** *** 138,142 **** self.lock.acquire() for key, value in self.cache.items(): ! self.expiredCache[id] = ref(obj) self.cache = {} self.lock.release() --- 138,142 ---- self.lock.acquire() for key, value in self.cache.items(): ! self.expiredCache[key] = ref(obj) self.cache = {} self.lock.release() |
From: <ian...@us...> - 2003-07-15 02:16:10
|
Update of /cvsroot/sqlobject/SQLObject/SQLObject In directory sc8-pr-cvs1:/tmp/cvs-serv17752 Modified Files: Style.py Log Message: Define true and false for old 2.2 interpreters Index: Style.py =================================================================== RCS file: /cvsroot/sqlobject/SQLObject/SQLObject/Style.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Style.py 28 Jun 2003 22:20:37 -0000 1.4 --- Style.py 15 Jul 2003 02:16:07 -0000 1.5 *************** *** 4,7 **** --- 4,9 ---- "MixedCaseStyle"] + True, False = 1==1, 0==1 + class Style(object): |
From: <ian...@us...> - 2003-07-10 21:53:41
|
Update of /cvsroot/sqlobject/SQLObject/SQLObject In directory sc8-pr-cvs1:/tmp/cvs-serv31194/SQLObject Modified Files: SQLObject.py Log Message: Fixed SelectResults so that it took a list as orderBy Index: SQLObject.py =================================================================== RCS file: /cvsroot/sqlobject/SQLObject/SQLObject/SQLObject.py,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** SQLObject.py 26 Jun 2003 08:33:56 -0000 1.46 --- SQLObject.py 10 Jul 2003 19:16:07 -0000 1.47 *************** *** 979,994 **** self.ops['orderBy'] = sourceClass._defaultOrder orderBy = self.ops['orderBy'] ! if orderBy is not None: ! if isinstance(orderBy, str) and orderBy.startswith('-'): ! orderBy = orderBy[1:] ! desc = True ! else: ! desc = False ! if sourceClass._SO_columnDict.has_key(orderBy): ! self.ops['dbOrderBy'] = sourceClass._SO_columnDict[orderBy].dbName else: ! self.ops['dbOrderBy'] = orderBy if desc: ! self.ops['dbOrderBy'] = '-' + self.ops['dbOrderBy'] def clone(self, **newOps): --- 979,1005 ---- self.ops['orderBy'] = sourceClass._defaultOrder orderBy = self.ops['orderBy'] ! if isinstance(orderBy, list) or isinstance(orderBy, tuple): ! orderBy = map(self._mungeOrderBy, orderBy) ! else: ! orderBy = self._mungeOrderBy(orderBy) ! self.ops['dbOrderBy'] = orderBy ! ! def _mungeOrderBy(self, orderBy): ! if isinstance(orderBy, str) and orderBy.startswith('-'): ! orderBy = orderBy[1:] ! desc = True ! else: ! desc = False ! if self.sourceClass._SO_columnDict.has_key(orderBy): ! val = self.sourceClass._SO_columnDict[orderBy].dbName ! if desc: ! return '-' + val else: ! return val ! else: if desc: ! return SQLBuilder.DESC(orderBy) ! else: ! return orderBy def clone(self, **newOps): |
From: <ian...@us...> - 2003-07-10 20:56:17
|
Update of /cvsroot/sqlobject/SQLObject/tests In directory sc8-pr-cvs1:/tmp/cvs-serv31330/tests Modified Files: test.py Log Message: Added test for lists of orderBy Index: test.py =================================================================== RCS file: /cvsroot/sqlobject/SQLObject/tests/test.py,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** test.py 28 Jun 2003 22:20:55 -0000 1.18 --- test.py 10 Jul 2003 19:16:52 -0000 1.19 *************** *** 96,101 **** ! ######################################## --- 96,131 ---- ! ######################################## ! ## Fancy sort ! ######################################## ! ! class Names(SQLObject): ! ! fname = StringCol(length=30) ! lname = StringCol(length=30) ! ! _defaultOrder = ['lname', 'fname'] ! ! class NamesTest(SQLObjectTest): ! ! classes = [Names] ! ! def inserts(self): ! for fname, lname in [('aj', 'baker'), ('joe', 'robbins'), ! ('tim', 'jackson'), ('joe', 'baker'), ! ('zoe', 'robbins')]: ! Names.new(fname=fname, lname=lname) ! ! def testDefaultOrder(self): ! self.assertEqual([(n.fname, n.lname) for n in Names.select()], ! [('aj', 'baker'), ('joe', 'baker'), ! ('tim', 'jackson'), ('joe', 'robbins'), ! ('zoe', 'robbins')]) + def testOtherOrder(self): + self.assertEqual([(n.fname, n.lname) for n in Names.select().orderBy(['fname', 'lname'])], + [('aj', 'baker'), ('joe', 'baker'), + ('joe', 'robbins'), ('tim', 'jackson'), + ('zoe', 'robbins')]) ######################################## |
From: <ian...@us...> - 2003-07-10 20:31:57
|
Update of /cvsroot/sqlobject/SQLObject/tests In directory sc8-pr-cvs1:/tmp/cvs-serv408/tests Modified Files: test.py Log Message: Added transaction test Index: test.py =================================================================== RCS file: /cvsroot/sqlobject/SQLObject/tests/test.py,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** test.py 10 Jul 2003 19:16:52 -0000 1.19 --- test.py 10 Jul 2003 19:25:47 -0000 1.20 *************** *** 143,146 **** --- 143,164 ---- self.assertEqual(list(TestSO1.select('all')), []) + ######################################## + ## Transaction test + ######################################## + + class TransactionTest(SQLObjectTest): + + classes = [Names] + + def inserts(self): + Names.new(fname='bob', lname='jones') + + def testTransaction(self): + if not self.supportTransactions: return + trans = Names._connection.transaction() + Names.new(fname='joe', lname='jones', connection=trans) + trans.rollback() + self.assertEqual([n.fname for n in Names.select()], + ['bob']) |
From: <ian...@us...> - 2003-07-10 20:02:32
|
Update of /cvsroot/sqlobject/SQLObject/SQLObject In directory sc8-pr-cvs1:/tmp/cvs-serv619/SQLObject Modified Files: DBConnection.py Log Message: Added the (needed) cache object to Transaction Index: DBConnection.py =================================================================== RCS file: /cvsroot/sqlobject/SQLObject/SQLObject/DBConnection.py,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** DBConnection.py 10 Jul 2003 19:01:27 -0000 1.38 --- DBConnection.py 10 Jul 2003 19:27:50 -0000 1.39 *************** *** 50,53 **** --- 50,54 ---- self.debug = debug self.cache = CacheSet(cache=cache) + self.doCache = cache self.style = style *************** *** 330,333 **** --- 331,335 ---- self._dbConnection = dbConnection self._connection = dbConnection.getConnection() + self.cache = CacheSet(cache=dbConnection.doCache) def query(self, s): *************** *** 349,353 **** self.rollback() self._dbConnection.releaseConnection(self._connection) ! class MySQLConnection(DBAPI): --- 351,355 ---- self.rollback() self._dbConnection.releaseConnection(self._connection) ! class MySQLConnection(DBAPI): |
From: <ian...@us...> - 2003-07-10 19:42:13
|
Update of /cvsroot/sqlobject/SQLObject/docs In directory sc8-pr-cvs1:/tmp/cvs-serv726/docs Modified Files: SQLObject.txt Log Message: typo (_cacheValue -> _cacheValues) Index: SQLObject.txt =================================================================== RCS file: /cvsroot/sqlobject/SQLObject/docs/SQLObject.txt,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** SQLObject.txt 28 Jun 2003 22:36:20 -0000 1.14 --- SQLObject.txt 10 Jul 2003 19:28:50 -0000 1.15 *************** *** 699,703 **** message to the `psycopg` connection. ! If you want to use transactions you should also turn `_cacheValue` off, like: --- 699,703 ---- message to the `psycopg` connection. ! If you want to use transactions you should also turn `_cacheValues` off, like: |
From: <ian...@us...> - 2003-07-10 19:39:02
|
Update of /cvsroot/sqlobject/SQLObject/SQLObject In directory sc8-pr-cvs1:/tmp/cvs-serv28749/SQLObject Modified Files: DBConnection.py Log Message: Added close method to DBMConnection, run that on __del__ or atexit. Without the close, .db files are not written with new information. Index: DBConnection.py =================================================================== RCS file: /cvsroot/sqlobject/SQLObject/SQLObject/DBConnection.py,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** DBConnection.py 30 Jun 2003 22:43:06 -0000 1.37 --- DBConnection.py 10 Jul 2003 19:01:27 -0000 1.38 *************** *** 31,34 **** --- 31,35 ---- import re import warnings + import atexit warnings.filterwarnings("ignore", "DB-API extension cursor.lastrowid used") *************** *** 705,708 **** --- 706,711 ---- self._meta = anydbm.open(os.path.join(path, "meta.db"), "c") self._tables = {} + atexit.register(self.close) + self._closed = 0 FileConnection.__init__(self, **kw) *************** *** 726,729 **** --- 729,746 ---- self._tables[table] = db return db + + def close(self): + if self._closed: + return + self._closed = 1 + self._meta.close() + del self._meta + for table in self._tables.values(): + table.close() + del self._tables + + def __del__(self): + FileConnection.__del__(self) + self.close() def _openTable(self, table): |
From: <ian...@us...> - 2003-07-05 18:43:42
|
Update of /cvsroot/sqlobject/SOWeb/docs In directory sc8-pr-cvs1:/tmp/cvs-serv16069/docs Modified Files: default.css Log Message: Added note about IRC Index: default.css =================================================================== RCS file: /cvsroot/sqlobject/SOWeb/docs/default.css,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 |
From: <ian...@us...> - 2003-07-05 18:43:42
|
Update of /cvsroot/sqlobject/SOWeb In directory sc8-pr-cvs1:/tmp/cvs-serv16069 Modified Files: index.html index.txt Log Message: Added note about IRC Index: index.html =================================================================== RCS file: /cvsroot/sqlobject/SOWeb/index.html,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** index.html 5 Jul 2003 04:47:02 -0000 1.6 --- index.html 5 Jul 2003 18:43:39 -0000 1.7 *************** *** 96,99 **** --- 96,100 ---- </pre> <p><a class="reference" href="http://sourceforge.net/cvs/?group_id=74338">Read more about CVS access</a> or <a class="reference" href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/sqlobject">browse CVS online</a>.</p> + <p>The author sometimes hangs out in IRC on <tt class="literal"><span class="pre">#webware</span></tt> on <tt class="literal"><span class="pre">irc.freenode.net</span></tt>.</p> </div> <div class="section" id="bugs-patches-etc"> Index: index.txt =================================================================== RCS file: /cvsroot/sqlobject/SOWeb/index.txt,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** index.txt 5 Jul 2003 04:39:06 -0000 1.4 --- index.txt 5 Jul 2003 18:43:39 -0000 1.5 *************** *** 94,97 **** --- 94,99 ---- .. _browse CVS online: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/sqlobject + The author sometimes hangs out in IRC on ``#webware`` on ``irc.freenode.net``. + Bugs, patches, etc ================== |
From: <ian...@us...> - 2003-07-05 04:47:22
|
Update of /cvsroot/sqlobject/SOWeb In directory sc8-pr-cvs1:/tmp/cvs-serv22908 Modified Files: index.html Log Message: got rid of header backlinks Index: index.html =================================================================== RCS file: /cvsroot/sqlobject/SOWeb/index.html,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** index.html 5 Jul 2003 04:39:06 -0000 1.5 --- index.html 5 Jul 2003 04:47:02 -0000 1.6 *************** *** 23,27 **** </div> <div class="section" id="introduction"> ! <h1><a class="toc-backref" href="#id8" name="introduction">Introduction</a></h1> <p>SQLObject is an <em>object-relational mapper</em>. It allows you to translate RDBMS table rows into Python objects, and manipulate those --- 23,27 ---- </div> <div class="section" id="introduction"> ! <h1><a name="introduction">Introduction</a></h1> <p>SQLObject is an <em>object-relational mapper</em>. It allows you to translate RDBMS table rows into Python objects, and manipulate those *************** *** 38,42 **** </div> <div class="section" id="example"> ! <h1><a class="toc-backref" href="#id9" name="example">Example</a></h1> <p>I love examples. Examples give a feel for the aesthetic of the API, which matters to me a great deal. This is just a snippet that creates --- 38,42 ---- </div> <div class="section" id="example"> ! <h1><a name="example">Example</a></h1> <p>I love examples. Examples give a feel for the aesthetic of the API, which matters to me a great deal. This is just a snippet that creates *************** *** 86,90 **** </div> <div class="section" id="community"> ! <h1><a class="toc-backref" href="#id10" name="community">Community</a></h1> <p><a class="reference" href="http://lists.sourceforge.net/lists/listinfo/sqlobject-discuss">Join the mailing list</a> or visit the <a class="reference" href="http://sourceforge.net/mailarchive/forum.php?forum=sqlobject-discuss">sqlobject-discuss archives</a>.</p> <p>If you are tracking changes, keeping up with CVS is helpful. To --- 86,90 ---- </div> <div class="section" id="community"> ! <h1><a name="community">Community</a></h1> <p><a class="reference" href="http://lists.sourceforge.net/lists/listinfo/sqlobject-discuss">Join the mailing list</a> or visit the <a class="reference" href="http://sourceforge.net/mailarchive/forum.php?forum=sqlobject-discuss">sqlobject-discuss archives</a>.</p> <p>If you are tracking changes, keeping up with CVS is helpful. To *************** *** 98,102 **** </div> <div class="section" id="bugs-patches-etc"> ! <h1><a class="toc-backref" href="#id11" name="bugs-patches-etc">Bugs, patches, etc</a></h1> <p>Please submit bugs and patches to the <a class="reference" href="http://sourceforge.net/tracker/?atid=540672&group_id=74338&func=browse">SourceForge bug tracker</a>. You might want to send mail to the mailing list before generating --- 98,102 ---- </div> <div class="section" id="bugs-patches-etc"> ! <h1><a name="bugs-patches-etc">Bugs, patches, etc</a></h1> <p>Please submit bugs and patches to the <a class="reference" href="http://sourceforge.net/tracker/?atid=540672&group_id=74338&func=browse">SourceForge bug tracker</a>. You might want to send mail to the mailing list before generating *************** *** 107,111 **** </div> <div class="section" id="download"> ! <h1><a class="toc-backref" href="#id12" name="download">Download</a></h1> <p><a class="reference" href="http://prdownloads.sourceforge.net/sqlobject/SQLObject-0.4.tar.gz?download">SQLObject-0.4.tar.gz</a></p> <p><a class="reference" href="http://prdownloads.sourceforge.net/sqlobject/SQLObject-0.4-1.noarch.rpm?download">SQLObject-0.4-1.noarch.rpm</a></p> --- 107,111 ---- </div> <div class="section" id="download"> ! <h1><a name="download">Download</a></h1> <p><a class="reference" href="http://prdownloads.sourceforge.net/sqlobject/SQLObject-0.4.tar.gz?download">SQLObject-0.4.tar.gz</a></p> <p><a class="reference" href="http://prdownloads.sourceforge.net/sqlobject/SQLObject-0.4-1.noarch.rpm?download">SQLObject-0.4-1.noarch.rpm</a></p> *************** *** 113,117 **** </div> <div class="section" id="documentation"> ! <h1><a class="toc-backref" href="#id13" name="documentation">Documentation</a></h1> <p><a class="reference" href="docs/News.html">New in 0.4</a></p> <p><a class="reference" href="docs/SQLObject.html">SQLObject documentation</a></p> --- 113,117 ---- </div> <div class="section" id="documentation"> ! <h1><a name="documentation">Documentation</a></h1> <p><a class="reference" href="docs/News.html">New in 0.4</a></p> <p><a class="reference" href="docs/SQLObject.html">SQLObject documentation</a></p> |
From: <ian...@us...> - 2003-07-05 04:47:21
|
Update of /cvsroot/sqlobject/SOWeb/docs In directory sc8-pr-cvs1:/tmp/cvs-serv22908/docs Modified Files: SQLObject.html build default.css Log Message: got rid of header backlinks Index: SQLObject.html =================================================================== RCS file: /cvsroot/sqlobject/SOWeb/docs/SQLObject.html,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SQLObject.html 5 Jul 2003 04:39:07 -0000 1.4 --- SQLObject.html 5 Jul 2003 04:47:02 -0000 1.5 *************** *** 74,78 **** </div> <div class="section" id="author-site-and-license"> ! <h1><a class="toc-backref" href="#id7" name="author-site-and-license">Author, Site, and License</a></h1> <p>SQLObject is by Ian Bicking (<a class="reference" href="mailto:ianb@colorstudy.com">ianb@colorstudy.com</a>). The website is <a class="reference" href="http://sqlobject.org">sqlobject.org</a>.</p> --- 74,78 ---- </div> <div class="section" id="author-site-and-license"> ! <h1><a name="author-site-and-license">Author, Site, and License</a></h1> <p>SQLObject is by Ian Bicking (<a class="reference" href="mailto:ianb@colorstudy.com">ianb@colorstudy.com</a>). The website is <a class="reference" href="http://sqlobject.org">sqlobject.org</a>.</p> *************** *** 85,89 **** </div> <div class="section" id="introduction"> ! <h1><a class="toc-backref" href="#id8" name="introduction">Introduction</a></h1> <p>SQLObject is an <em>object-relational mapper</em>. It allows you to translate RDBMS table rows into Python objects, and manipulate those --- 85,89 ---- </div> <div class="section" id="introduction"> ! <h1><a name="introduction">Introduction</a></h1> <p>SQLObject is an <em>object-relational mapper</em>. It allows you to translate RDBMS table rows into Python objects, and manipulate those *************** *** 99,103 **** </div> <div class="section" id="requirements"> ! <h1><a class="toc-backref" href="#id9" name="requirements">Requirements</a></h1> <p>Currently SQLObject supports MySQL, PostgreSQL (via <tt class="literal"><span class="pre">psycopg</span></tt>), SQLite, and a DBM-based store. The DBM backend is the youngest, --- 99,103 ---- </div> <div class="section" id="requirements"> ! <h1><a name="requirements">Requirements</a></h1> <p>Currently SQLObject supports MySQL, PostgreSQL (via <tt class="literal"><span class="pre">psycopg</span></tt>), SQLite, and a DBM-based store. The DBM backend is the youngest, *************** *** 107,111 **** </div> <div class="section" id="compared-to-other-database-wrappers"> ! <h1><a class="toc-backref" href="#id10" name="compared-to-other-database-wrappers">Compared To Other Database Wrappers</a></h1> <p>There are several object-relational mappers (ORM) for Python. I honestly can't comment deeply on the quality of those packages, but --- 107,111 ---- </div> <div class="section" id="compared-to-other-database-wrappers"> ! <h1><a name="compared-to-other-database-wrappers">Compared To Other Database Wrappers</a></h1> <p>There are several object-relational mappers (ORM) for Python. I honestly can't comment deeply on the quality of those packages, but *************** *** 153,157 **** </div> <div class="section" id="future"> ! <h1><a class="toc-backref" href="#id11" name="future">Future</a></h1> <p>Here are some things I plan:</p> <ul class="simple"> --- 153,157 ---- </div> <div class="section" id="future"> ! <h1><a name="future">Future</a></h1> <p>Here are some things I plan:</p> <ul class="simple"> *************** *** 173,180 **** </div> <div class="section" id="using-sqlobject-an-introduction"> ! <h1><a class="toc-backref" href="#id12" name="using-sqlobject-an-introduction">Using SQLObject: An Introduction</a></h1> <p>Let's start off quickly...</p> <div class="section" id="declaring-the-class"> ! <h2><a class="toc-backref" href="#id13" name="declaring-the-class">Declaring the Class</a></h2> <p>To begin with, let's make a database connection. Choose from one of <cite>MySQLConnection</cite>, <cite>PostgresConnection</cite>, <cite>SQLiteConnection</cite>, and --- 173,180 ---- </div> <div class="section" id="using-sqlobject-an-introduction"> ! <h1><a name="using-sqlobject-an-introduction">Using SQLObject: An Introduction</a></h1> <p>Let's start off quickly...</p> <div class="section" id="declaring-the-class"> ! <h2><a name="declaring-the-class">Declaring the Class</a></h2> <p>To begin with, let's make a database connection. Choose from one of <cite>MySQLConnection</cite>, <cite>PostgresConnection</cite>, <cite>SQLiteConnection</cite>, and *************** *** 240,244 **** </div> <div class="section" id="using-the-class"> ! <h2><a class="toc-backref" href="#id14" name="using-the-class">Using the Class</a></h2> <p>Now that you have a class, how will you use it? We'll be considering the class defined above.</p> --- 240,244 ---- </div> <div class="section" id="using-the-class"> ! <h2><a name="using-the-class">Using the Class</a></h2> <p>Now that you have a class, how will you use it? We'll be considering the class defined above.</p> *************** *** 332,336 **** </div> <div class="section" id="one-to-many-relationships"> ! <h2><a class="toc-backref" href="#id15" name="one-to-many-relationships">One-to-Many Relationships</a></h2> <p>Well, a real address book should have people, but also addresses. These examples are in <tt class="literal"><span class="pre">personaddress.py</span></tt></p> --- 332,336 ---- </div> <div class="section" id="one-to-many-relationships"> ! <h2><a name="one-to-many-relationships">One-to-Many Relationships</a></h2> <p>Well, a real address book should have people, but also addresses. These examples are in <tt class="literal"><span class="pre">personaddress.py</span></tt></p> *************** *** 376,380 **** </div> <div class="section" id="many-to-many-relationships"> ! <h2><a class="toc-backref" href="#id16" name="many-to-many-relationships">Many-to-Many Relationships</a></h2> <p>For this example we will have user and role objects. The two have a many-to-many relationship, which is represented with the --- 376,380 ---- </div> <div class="section" id="many-to-many-relationships"> ! <h2><a name="many-to-many-relationships">Many-to-Many Relationships</a></h2> <p>For this example we will have user and role objects. The two have a many-to-many relationship, which is represented with the *************** *** 443,447 **** </div> <div class="section" id="selecting-multiple-objects"> ! <h2><a class="toc-backref" href="#id17" name="selecting-multiple-objects">Selecting Multiple Objects</a></h2> <p>While the full power of all the kinds of joins you can do with a database are not revealed in SQLObject, a simple <tt class="literal"><span class="pre">SELECT</span></tt> is --- 443,447 ---- </div> <div class="section" id="selecting-multiple-objects"> ! <h2><a name="selecting-multiple-objects">Selecting Multiple Objects</a></h2> <p>While the full power of all the kinds of joins you can do with a database are not revealed in SQLObject, a simple <tt class="literal"><span class="pre">SELECT</span></tt> is *************** *** 509,513 **** </div> <div class="section" id="customizing-the-objects"> ! <h2><a class="toc-backref" href="#id18" name="customizing-the-objects">Customizing the Objects</a></h2> <p>While we haven't done so in the examples, you can include your own methods in the class definition. Writing you own methods should be --- 509,513 ---- </div> <div class="section" id="customizing-the-objects"> ! <h2><a name="customizing-the-objects">Customizing the Objects</a></h2> <p>While we haven't done so in the examples, you can include your own methods in the class definition. Writing you own methods should be *************** *** 515,519 **** some other details to be aware of.</p> <div class="section" id="initializing-the-objects"> ! <h3><a class="toc-backref" href="#id19" name="initializing-the-objects">Initializing the Objects</a></h3> <p>With new-style classes, <cite>__init__</cite> is called everytime the class is called. That means it's called when an object is just fetched from --- 515,519 ---- some other details to be aware of.</p> <div class="section" id="initializing-the-objects"> ! <h3><a name="initializing-the-objects">Initializing the Objects</a></h3> <p>With new-style classes, <cite>__init__</cite> is called everytime the class is called. That means it's called when an object is just fetched from *************** *** 523,527 **** </div> <div class="section" id="adding-magic-attributes-properties"> ! <h3><a class="toc-backref" href="#id20" name="adding-magic-attributes-properties">Adding Magic Attributes (properties)</a></h3> <p>You can use all the normal techniques for defining this new-style class, including <cite>classmethod</cite>, <cite>staticmethod</cite>, and <cite>property</cite>, but --- 523,527 ---- </div> <div class="section" id="adding-magic-attributes-properties"> ! <h3><a name="adding-magic-attributes-properties">Adding Magic Attributes (properties)</a></h3> <p>You can use all the normal techniques for defining this new-style class, including <cite>classmethod</cite>, <cite>staticmethod</cite>, and <cite>property</cite>, but *************** *** 571,575 **** </div> <div class="section" id="overriding-column-attributes"> ! <h3><a class="toc-backref" href="#id21" name="overriding-column-attributes">Overriding Column Attributes</a></h3> <p>It's a little more complicated if you want to override the behavior of an database column attribute. For instance, imagine there's special --- 571,575 ---- </div> <div class="section" id="overriding-column-attributes"> ! <h3><a name="overriding-column-attributes">Overriding Column Attributes</a></h3> <p>It's a little more complicated if you want to override the behavior of an database column attribute. For instance, imagine there's special *************** *** 630,639 **** </div> <div class="section" id="reference"> ! <h1><a class="toc-backref" href="#id22" name="reference">Reference</a></h1> <p>The instructions above should tell you enough to get you started, and be useful for many situations. Now we'll show how to specify the class more completely.</p> <div class="section" id="col-class-specifying-columns"> ! <h2><a class="toc-backref" href="#id23" name="col-class-specifying-columns">Col Class: Specifying Columns</a></h2> <p>The list of columns is a list of <cite>Col</cite> objects. These objects don't have functionality in themselves, but give you a way to specify the --- 630,639 ---- </div> <div class="section" id="reference"> ! <h1><a name="reference">Reference</a></h1> <p>The instructions above should tell you enough to get you started, and be useful for many situations. Now we'll show how to specify the class more completely.</p> <div class="section" id="col-class-specifying-columns"> ! <h2><a name="col-class-specifying-columns">Col Class: Specifying Columns</a></h2> <p>The list of columns is a list of <cite>Col</cite> objects. These objects don't have functionality in themselves, but give you a way to specify the *************** *** 675,679 **** </dl> <div class="section" id="subclasses-of-col"> ! <h3><a class="toc-backref" href="#id24" name="subclasses-of-col">Subclasses of Col</a></h3> <p>The <cite>ForeignKey</cite> class should be used instead of <cite>Col</cite> when the column is a reference to another table/class. It is generally used like --- 675,679 ---- </dl> <div class="section" id="subclasses-of-col"> ! <h3><a name="subclasses-of-col">Subclasses of Col</a></h3> <p>The <cite>ForeignKey</cite> class should be used instead of <cite>Col</cite> when the column is a reference to another table/class. It is generally used like *************** *** 722,726 **** </div> <div class="section" id="sqlobject-class-specifying-your-class"> ! <h2><a class="toc-backref" href="#id25" name="sqlobject-class-specifying-your-class">SQLObject Class: Specifying Your Class</a></h2> <p>In addition to the columns, there are a number of other special attributes you can set in your class.</p> --- 722,726 ---- </div> <div class="section" id="sqlobject-class-specifying-your-class"> ! <h2><a name="sqlobject-class-specifying-your-class">SQLObject Class: Specifying Your Class</a></h2> <p>In addition to the columns, there are a number of other special attributes you can set in your class.</p> *************** *** 758,767 **** </div> <div class="section" id="relationships-between-classes-tables"> ! <h2><a class="toc-backref" href="#id26" name="relationships-between-classes-tables">Relationships Between Classes/Tables</a></h2> <p>You can use the <cite>ForeignKey</cite> to handle foreign references in a table, but for back references and many-to-many relationships you'll use joins.</p> <div class="section" id="multiplejoin-one-to-many"> ! <h3><a class="toc-backref" href="#id27" name="multiplejoin-one-to-many">MultipleJoin: One-to-Many</a></h3> <p>See <a class="reference" href="#one-to-many-relationships">One-to-Many Relationships</a> for an example of one-to-many relationships.</p> --- 758,767 ---- </div> <div class="section" id="relationships-between-classes-tables"> ! <h2><a name="relationships-between-classes-tables">Relationships Between Classes/Tables</a></h2> <p>You can use the <cite>ForeignKey</cite> to handle foreign references in a table, but for back references and many-to-many relationships you'll use joins.</p> <div class="section" id="multiplejoin-one-to-many"> ! <h3><a name="multiplejoin-one-to-many">MultipleJoin: One-to-Many</a></h3> <p>See <a class="reference" href="#one-to-many-relationships">One-to-Many Relationships</a> for an example of one-to-many relationships.</p> *************** *** 784,788 **** </div> <div class="section" id="relatedjoin-many-to-many"> ! <h3><a class="toc-backref" href="#id28" name="relatedjoin-many-to-many">RelatedJoin: Many-to-Many</a></h3> <p>See <a class="reference" href="#many-to-many-relationships">Many-to-Many Relationships</a> for examples of using many-to-many joins.</p> <p><cite>RelatedJoin</cite> has all the keyword arguments of <a class="reference" href="#multiple-join-keywords">MultipleJoin</a>, plus:</p> --- 784,788 ---- </div> <div class="section" id="relatedjoin-many-to-many"> ! <h3><a name="relatedjoin-many-to-many">RelatedJoin: Many-to-Many</a></h3> <p>See <a class="reference" href="#many-to-many-relationships">Many-to-Many Relationships</a> for examples of using many-to-many joins.</p> <p><cite>RelatedJoin</cite> has all the keyword arguments of <a class="reference" href="#multiple-join-keywords">MultipleJoin</a>, plus:</p> *************** *** 829,833 **** </div> <div class="section" id="transactions"> ! <h2><a class="toc-backref" href="#id29" name="transactions">Transactions</a></h2> <p>Transaction support in SQLObject is left to the database. Transactions can be used like:</p> --- 829,833 ---- </div> <div class="section" id="transactions"> ! <h2><a name="transactions">Transactions</a></h2> <p>Transaction support in SQLObject is left to the database. Transactions can be used like:</p> *************** *** 853,857 **** </div> <div class="section" id="automatic-schema-generation"> ! <h2><a class="toc-backref" href="#id30" name="automatic-schema-generation">Automatic Schema Generation</a></h2> <p>All the connections support creating and droping tables based on the class definition. First you have to prepare your class definition, --- 853,857 ---- </div> <div class="section" id="automatic-schema-generation"> ! <h2><a name="automatic-schema-generation">Automatic Schema Generation</a></h2> <p>All the connections support creating and droping tables based on the class definition. First you have to prepare your class definition, *************** *** 859,863 **** <a class="reference" href="#dbmconnection">DBMConnection</a> do not require or use type information).</p> <div class="section" id="columns-types"> ! <h3><a class="toc-backref" href="#id31" name="columns-types">Columns Types</a></h3> <p>A column type is indicated by using a subclass of <cite>Col</cite>:</p> <dl> --- 859,863 ---- <a class="reference" href="#dbmconnection">DBMConnection</a> do not require or use type information).</p> <div class="section" id="columns-types"> ! <h3><a name="columns-types">Columns Types</a></h3> <p>A column type is indicated by using a subclass of <cite>Col</cite>:</p> <dl> *************** *** 893,897 **** </div> <div class="section" id="creating-and-dropping-tables"> ! <h3><a class="toc-backref" href="#id32" name="creating-and-dropping-tables">Creating and Dropping Tables</a></h3> <p>To create a table call <cite>createTable</cite>. It takes two arguments:</p> <dl> --- 893,897 ---- </div> <div class="section" id="creating-and-dropping-tables"> ! <h3><a name="creating-and-dropping-tables">Creating and Dropping Tables</a></h3> <p>To create a table call <cite>createTable</cite>. It takes two arguments:</p> <dl> *************** *** 910,919 **** </div> <div class="section" id="dynamic-classes"> ! <h1><a class="toc-backref" href="#id33" name="dynamic-classes">Dynamic Classes</a></h1> <p>SQLObject classes can be manipulated dynamically. This leaves open the possibility of constructing SQLObject classes from an XML file, from database introspection, or from a graphical interface.</p> <div class="section" id="automatic-class-generation"> ! <h2><a class="toc-backref" href="#id34" name="automatic-class-generation">Automatic Class Generation</a></h2> <p>SQLObject can read the table description from the database, and fill in the class columns (as would normally be described in the <cite>_columns</cite> --- 910,919 ---- </div> <div class="section" id="dynamic-classes"> ! <h1><a name="dynamic-classes">Dynamic Classes</a></h1> <p>SQLObject classes can be manipulated dynamically. This leaves open the possibility of constructing SQLObject classes from an XML file, from database introspection, or from a graphical interface.</p> <div class="section" id="automatic-class-generation"> ! <h2><a name="automatic-class-generation">Automatic Class Generation</a></h2> <p>SQLObject can read the table description from the database, and fill in the class columns (as would normally be described in the <cite>_columns</cite> *************** *** 929,933 **** </div> <div class="section" id="runtime-column-changes"> ! <h2><a class="toc-backref" href="#id35" name="runtime-column-changes">Runtime Column Changes</a></h2> <p><em>SQLite does not support this feature</em></p> <p>You can add and remove columns to your class at runtime. Such changes --- 929,933 ---- </div> <div class="section" id="runtime-column-changes"> ! <h2><a name="runtime-column-changes">Runtime Column Changes</a></h2> <p><em>SQLite does not support this feature</em></p> <p>You can add and remove columns to your class at runtime. Such changes *************** *** 949,958 **** </div> <div class="section" id="legacy-database-schemas"> ! <h1><a class="toc-backref" href="#id36" name="legacy-database-schemas">Legacy Database Schemas</a></h1> <p>Often you will have a database that already exists, and does not use the naming conventions that SQLObject expects, or does not use any naming convention at all.</p> <div class="section" id="sqlobject-requirements"> ! <h2><a class="toc-backref" href="#id37" name="sqlobject-requirements">SQLObject requirements</a></h2> <p>While SQLObject tries not to make too many requirements on your schema, some assumptions are made. Some of these may be relaxed in --- 949,958 ---- </div> <div class="section" id="legacy-database-schemas"> ! <h1><a name="legacy-database-schemas">Legacy Database Schemas</a></h1> <p>Often you will have a database that already exists, and does not use the naming conventions that SQLObject expects, or does not use any naming convention at all.</p> <div class="section" id="sqlobject-requirements"> ! <h2><a name="sqlobject-requirements">SQLObject requirements</a></h2> <p>While SQLObject tries not to make too many requirements on your schema, some assumptions are made. Some of these may be relaxed in *************** *** 979,983 **** </div> <div class="section" id="changing-the-naming-style"> ! <h2><a class="toc-backref" href="#id38" name="changing-the-naming-style">Changing the Naming Style</a></h2> <p>By default names in SQLObject are expected to be mixed case in Python (like <tt class="literal"><span class="pre">mixedCase</span></tt>), and underscore-separated in SQL (like --- 979,983 ---- </div> <div class="section" id="changing-the-naming-style"> ! <h2><a name="changing-the-naming-style">Changing the Naming Style</a></h2> <p>By default names in SQLObject are expected to be mixed case in Python (like <tt class="literal"><span class="pre">mixedCase</span></tt>), and underscore-separated in SQL (like *************** *** 1015,1019 **** </div> <div class="section" id="irregular-naming"> ! <h2><a class="toc-backref" href="#id39" name="irregular-naming">Irregular Naming</a></h2> <p>While naming conventions are nice, they are not always present. You can control most of the names that SQLObject uses, independent of the --- 1015,1019 ---- </div> <div class="section" id="irregular-naming"> ! <h2><a name="irregular-naming">Irregular Naming</a></h2> <p>While naming conventions are nice, they are not always present. You can control most of the names that SQLObject uses, independent of the *************** *** 1034,1038 **** </div> <div class="section" id="dbconnection-database-connections"> ! <h1><a class="toc-backref" href="#id40" name="dbconnection-database-connections">DBConnection: Database Connections</a></h1> <p>The <cite>DBConnection</cite> module currently has four external classes, <cite>MySQLConnection</cite>, <cite>PostgresConnection</cite>, <cite>SQLiteConnection</cite>, --- 1034,1038 ---- </div> <div class="section" id="dbconnection-database-connections"> ! <h1><a name="dbconnection-database-connections">DBConnection: Database Connections</a></h1> <p>The <cite>DBConnection</cite> module currently has four external classes, <cite>MySQLConnection</cite>, <cite>PostgresConnection</cite>, <cite>SQLiteConnection</cite>, *************** *** 1042,1046 **** console.</p> <div class="section" id="mysql"> ! <h2><a class="toc-backref" href="#id41" name="mysql">MySQL</a></h2> <p><cite>MySQLConnection</cite> takes the keyword arguments <cite>host</cite>, <cite>db</cite>, <cite>user</cite>, and <cite>passwd</cite>, just like <cite>MySQLdb.connect</cite> does.</p> --- 1042,1046 ---- console.</p> <div class="section" id="mysql"> ! <h2><a name="mysql">MySQL</a></h2> <p><cite>MySQLConnection</cite> takes the keyword arguments <cite>host</cite>, <cite>db</cite>, <cite>user</cite>, and <cite>passwd</cite>, just like <cite>MySQLdb.connect</cite> does.</p> *************** *** 1050,1054 **** </div> <div class="section" id="postgres"> ! <h2><a class="toc-backref" href="#id42" name="postgres">Postgres</a></h2> <p><cite>PostgresConnection</cite> takes a single connection string, like <tt class="literal"><span class="pre">"dbname=something</span> <span class="pre">user=some_user"</span></tt>, just like <cite>psycopg.connect</cite>. --- 1050,1054 ---- </div> <div class="section" id="postgres"> ! <h2><a name="postgres">Postgres</a></h2> <p><cite>PostgresConnection</cite> takes a single connection string, like <tt class="literal"><span class="pre">"dbname=something</span> <span class="pre">user=some_user"</span></tt>, just like <cite>psycopg.connect</cite>. *************** *** 1058,1062 **** </div> <div class="section" id="sqlite"> ! <h2><a class="toc-backref" href="#id43" name="sqlite">SQLite</a></h2> <p><cite>SQLiteConnection</cite> takes the a single string, which is the path to the database file.</p> --- 1058,1062 ---- </div> <div class="section" id="sqlite"> ! <h2><a name="sqlite">SQLite</a></h2> <p><cite>SQLiteConnection</cite> takes the a single string, which is the path to the database file.</p> *************** *** 1071,1075 **** </div> <div class="section" id="dbmconnection"> ! <h2><a class="toc-backref" href="#id44" name="dbmconnection">DBMConnection</a></h2> <p><cite>DBMConnection</cite> takes a single string, which is the path to a directory in which to store the database.</p> --- 1071,1075 ---- </div> <div class="section" id="dbmconnection"> ! <h2><a name="dbmconnection">DBMConnection</a></h2> <p><cite>DBMConnection</cite> takes a single string, which is the path to a directory in which to store the database.</p> *************** *** 1087,1091 **** </div> <div class="section" id="exported-symbols"> ! <h1><a class="toc-backref" href="#id45" name="exported-symbols">Exported Symbols</a></h1> <p>You can use <tt class="literal"><span class="pre">from</span> <span class="pre">SQLObject</span> <span class="pre">import</span> <span class="pre">*</span></tt>, though you don't have to. It exports a minimal number of symbols. The symbols exported:</p> --- 1087,1091 ---- </div> <div class="section" id="exported-symbols"> ! <h1><a name="exported-symbols">Exported Symbols</a></h1> <p>You can use <tt class="literal"><span class="pre">from</span> <span class="pre">SQLObject</span> <span class="pre">import</span> <span class="pre">*</span></tt>, though you don't have to. It exports a minimal number of symbols. The symbols exported:</p> Index: build =================================================================== RCS file: /cvsroot/sqlobject/SOWeb/docs/build,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** build 5 Jul 2003 04:39:07 -0000 1.4 --- build 5 Jul 2003 04:47:02 -0000 1.5 *************** *** 6,8 **** cp $SOURCEDIR/../examples/snippets/*.html ../examples/snippets/ cd .. ! buildhtml.py --- 6,8 ---- cp $SOURCEDIR/../examples/snippets/*.html ../examples/snippets/ cd .. ! buildhtml.py --no-toc-backlinks Index: default.css =================================================================== RCS file: /cvsroot/sqlobject/SOWeb/docs/default.css,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 |
From: <ian...@us...> - 2003-07-05 04:41:03
|
Update of /cvsroot/sqlobject/SOWeb/docs In directory sc8-pr-cvs1:/tmp/cvs-serv22441/docs Added Files: Authors.html Authors.txt Log Message: Added authors file --- NEW FILE: Authors.html --- <?xml version="1.0" encoding="utf-8" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="generator" content="Docutils 0.2.8: http://docutils.sourceforge.net/" /> <title>Authors</title> <link rel="stylesheet" href="default.css" type="text/css" /> </head> <body> <div class="document" id="authors"> <h1 class="title">Authors</h1> <p>SQLObject was originally written and continues to be maintained by Ian Bicking <<a class="reference" href="mailto:ianb@colorstudy.com">ianb@colorstudy.com</a>></p> <p>Contributions have been made by:</p> <ul class="simple"> <li>Frank Barknecht <<a class="reference" href="mailto:fbar@footils.org">fbar@footils.org</a>></li> <li>Bud P. Bruegger <<a class="reference" href="mailto:bug@sistema.it">bug@sistema.it</a>></li> <li>David M. Cook <<a class="reference" href="mailto:dave@davidcook.org">dave@davidcook.org</a>></li> <li>Luke Opperman <<a class="reference" href="mailto:luke@metathusalan.com">luke@metathusalan.com</a>></li> </ul> </div> </body> </html> --- NEW FILE: Authors.txt --- Authors ======= SQLObject was originally written and continues to be maintained by Ian Bicking <ia...@co...> Contributions have been made by: * Frank Barknecht <fb...@fo...> * Bud P. Bruegger <bu...@si...> * David M. Cook <da...@da...> * Luke Opperman <lu...@me...> |