sqlobject-cvs Mailing List for SQLObject (Page 184)
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: <dre...@us...> - 2003-09-25 20:40:29
|
Update of /cvsroot/sqlobject/SQLObject/tests In directory sc8-pr-cvs1:/tmp/cvs-serv21238/tests Modified Files: test.py test_converters.py Log Message: Added BoolCol with tests Index: test.py =================================================================== RCS file: /cvsroot/sqlobject/SQLObject/tests/test.py,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** test.py 24 Sep 2003 12:18:16 -0000 1.29 --- test.py 25 Sep 2003 20:40:25 -0000 1.30 *************** *** 436,440 **** age INT DEFAULT NULL, created DATETIME NOT NULL, ! happy char(1) DEFAULT 'Y' NOT NULL ) """ --- 436,441 ---- age INT DEFAULT NULL, created DATETIME NOT NULL, ! happy char(1) DEFAULT 'Y' NOT NULL, ! wannahavefun BOOL DEFAULT FALSE NOT NULL ) """ *************** *** 447,451 **** age INT DEFAULT 0, created VARCHAR(40) NOT NULL, ! happy char(1) DEFAULT 'Y' NOT NULL ) """ --- 448,453 ---- age INT DEFAULT 0, created VARCHAR(40) NOT NULL, ! happy char(1) DEFAULT 'Y' NOT NULL, ! wannahavefun BOOL DEFAULT FALSE NOT NULL ) """ *************** *** 468,479 **** _fromDatabase = True _connection = connection() ! AutoTest.new(firstName='john', ! lastName='doe', ! age=10, ! created=DateTime.now()) ! AutoTest.new(firstName='jane', ! lastName='doe', ! happy='N', ! created=DateTime.now()) reg = sys.modules[SQLObject.__module__].classRegistry[AutoTest._registry] del reg['AutoTest'] --- 470,485 ---- _fromDatabase = True _connection = connection() ! john = AutoTest.new(firstName='john', ! lastName='doe', ! age=10, ! created=DateTime.now(), ! wannahavefun=False) ! jane = AutoTest.new(firstName='jane', ! lastName='doe', ! happy='N', ! created=DateTime.now(), ! wannahavefun=True) ! self.failIf(john.wannahavefun) ! self.failUnless(jane.wannahavefun) reg = sys.modules[SQLObject.__module__].classRegistry[AutoTest._registry] del reg['AutoTest'] Index: test_converters.py =================================================================== RCS file: /cvsroot/sqlobject/SQLObject/tests/test_converters.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** test_converters.py 31 Jul 2003 14:25:33 -0000 1.3 --- test_converters.py 25 Sep 2003 20:40:25 -0000 1.4 *************** *** 74,77 **** --- 74,81 ---- self.assertEqual(sqlRepr(('one','two','three')), "('one', 'two', 'three')") + def test_bool(self): + self.assertEqual(sqlRepr(True), 'True') + self.assertEqual(sqlRepr(False), 'False') + def test_instance(self): instance = TestClass() |
From: <dre...@us...> - 2003-09-24 12:18:21
|
Update of /cvsroot/sqlobject/SQLObject/SQLObject/include In directory sc8-pr-cvs1:/tmp/cvs-serv2752/SQLObject/include Modified Files: Validator.py Log Message: Mostly whitespace and a fix for postgreSQLCreate Index: Validator.py =================================================================== RCS file: /cvsroot/sqlobject/SQLObject/SQLObject/include/Validator.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Validator.py 7 Sep 2003 22:35:09 -0000 1.1 --- Validator.py 24 Sep 2003 12:18:15 -0000 1.2 *************** *** 1,5 **** ## FormEncode, a Form processor ## Copyright (C) 2003, Ian Bicking <ia...@co...> ! ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public --- 1,5 ---- ## FormEncode, a Form processor ## Copyright (C) 2003, Ian Bicking <ia...@co...> ! ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public *************** *** 71,75 **** obj = All(*obj) return obj ! def _validateToSomething(obj, value, state, finisher): validator = getValidator(obj) --- 71,75 ---- obj = All(*obj) return obj ! def _validateToSomething(obj, value, state, finisher): validator = getValidator(obj) *************** *** 113,117 **** def message(self, name, default): ! if not self.messages: return default return self.messages.get(name, default) --- 113,117 ---- def message(self, name, default): ! if not self.messages: return default return self.messages.get(name, default) *************** *** 150,154 **** * .sqlToPython(value, state): * .pythonToSQL(value, state): ! Validators should have no internal state besides the values given at instantiation. They should be reusable and --- 150,154 ---- * .sqlToPython(value, state): * .pythonToSQL(value, state): ! Validators should have no internal state besides the values given at instantiation. They should be reusable and *************** *** 293,297 **** an integer, and then check if each integer is 1, 2, or 3. """ ! def attemptConvert(self, value, state, validate): newList = [] --- 293,297 ---- an integer, and then check if each integer is 1, 2, or 3. """ ! def attemptConvert(self, value, state, validate): newList = [] *************** *** 377,381 **** except Exception, e: raise InvalidField(str(e), value, state) ! return result class Constant(FancyValidator): --- 377,381 ---- except Exception, e: raise InvalidField(str(e), value, state) ! return result class Constant(FancyValidator): *************** *** 538,542 **** return i raise InvalidField("Item %s was not found in the list" ! % repr(value), value, state) class DateValidator(FancyValidator): --- 538,542 ---- return i raise InvalidField("Item %s was not found in the list" ! % repr(value), value, state) class DateValidator(FancyValidator): *************** *** 582,586 **** """ Converts things to string, but treats empty things as the empty ! string. """ --- 582,586 ---- """ Converts things to string, but treats empty things as the empty ! string. """ *************** *** 705,709 **** self.message('invalid', 'That is not a valid state code'), value, state) ! def _toPython(self, value, state): return string.strip(string.upper(value)) --- 705,709 ---- self.message('invalid', 'That is not a valid state code'), value, state) ! def _toPython(self, value, state): return string.strip(string.upper(value)) *************** *** 803,807 **** except DateTime.RangeError, v: raise InvalidField(self.message('invalidDay', 'That is not a valid day') + '(%s)' % v, value, state) ! def makeMonth(self, value): try: --- 803,807 ---- except DateTime.RangeError, v: raise InvalidField(self.message('invalidDay', 'That is not a valid day') + '(%s)' % v, value, state) ! def makeMonth(self, value): try: *************** *** 844,848 **** # @@ ib: double-check, improve return value.strftime("%m/%d/%Y") ! def unconvertMonth(self, value, state): # @@ ib: double-check, improve --- 844,848 ---- # @@ ib: double-check, improve return value.strftime("%m/%d/%Y") ! def unconvertMonth(self, value, state): # @@ ib: double-check, improve *************** *** 879,883 **** """ A FormValidator is something that can be chained with a ! Schema. Unlike normal chaining the FormValidator can validate forms that aren't entirely valid. --- 879,883 ---- """ A FormValidator is something that can be chained with a ! Schema. Unlike normal chaining the FormValidator can validate forms that aren't entirely valid. *************** *** 973,977 **** for name, value in errorList]), fieldDict, state, errorDict=errors) ! def _validateReturn(self, fieldDict, state): ccType = string.lower(string.strip(fieldDict[self._ccTypeField])) --- 973,977 ---- for name, value in errorList]), fieldDict, state, errorDict=errors) ! def _validateReturn(self, fieldDict, state): ccType = string.lower(string.strip(fieldDict[self._ccTypeField])) |
From: <dre...@us...> - 2003-09-24 12:18:21
|
Update of /cvsroot/sqlobject/SQLObject/tests In directory sc8-pr-cvs1:/tmp/cvs-serv2752/tests Modified Files: test.py Log Message: Mostly whitespace and a fix for postgreSQLCreate Index: test.py =================================================================== RCS file: /cvsroot/sqlobject/SQLObject/tests/test.py,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** test.py 7 Sep 2003 23:36:08 -0000 1.28 --- test.py 24 Sep 2003 12:18:16 -0000 1.29 *************** *** 58,62 **** bob.name = testString self.assertEqual(bob.name, testString) ! class TestCaseGetSet(TestCase1): --- 58,62 ---- bob.name = testString self.assertEqual(bob.name, testString) ! class TestCaseGetSet(TestCase1): *************** *** 67,71 **** bob.name = 'joe' self.assertEqual(bob.name, 'joe') ! class TestSO2(SQLObject): --- 67,71 ---- bob.name = 'joe' self.assertEqual(bob.name, 'joe') ! class TestSO2(SQLObject): *************** *** 119,124 **** tcc2 = TestSO3.new(name='c', other=tc4a.id) self.assertEqual(tcc2.other, tc4a) ! ! ######################################## ## Fancy sort --- 119,124 ---- tcc2 = TestSO3.new(name='c', other=tc4a.id) self.assertEqual(tcc2.other, tc4a) ! ! ######################################## ## Fancy sort *************** *** 160,164 **** class IterTest(SQLObject): name = StringCol() ! class IterationTestCase(SQLObjectTest): '''Test basic iteration techniques''' --- 160,164 ---- class IterTest(SQLObject): name = StringCol() ! class IterationTestCase(SQLObjectTest): '''Test basic iteration techniques''' *************** *** 268,272 **** finally: TestSOTrans._connection.autoCommit = True ! ######################################## --- 268,272 ---- finally: TestSOTrans._connection.autoCommit = True ! ######################################## *************** *** 316,320 **** for i in range(100): Counter.new(number=i) ! def counterEqual(self, counters, value): self.assertEquals([c.number for c in counters], value) --- 316,320 ---- for i in range(100): Counter.new(number=i) ! def counterEqual(self, counters, value): self.assertEquals([c.number for c in counters], value) *************** *** 418,422 **** l = [p.phone for p in Person.selectBy(name='tim')[0].phones] l.sort() ! self.assertEqual(l, ['555-394-2930', '555-555-5555']) Phone.delColumn(col, changeSchema=True) --- 418,422 ---- l = [p.phone for p in Person.selectBy(name='tim')[0].phones] l.sort() ! self.assertEqual(l, ['555-394-2930', '555-555-5555']) Phone.delColumn(col, changeSchema=True) *************** *** 517,521 **** self.assertZipsEqual(b.addressJoiners, ['22222']) self.assertNamesEqual(z.personJoiners, []) ! def assertZipsEqual(self, zips, dest): self.assertEqual([a.zip for a in zips], dest) --- 517,521 ---- self.assertZipsEqual(b.addressJoiners, ['22222']) self.assertNamesEqual(z.personJoiners, []) ! def assertZipsEqual(self, zips, dest): self.assertEqual([a.zip for a in zips], dest) *************** *** 547,551 **** #p1.addAddressJoiner2(a) AddressJoiner2.new(zip='00000', personJoiner2=p2) ! def test(self): bob = PersonJoiner2.byName('bob') --- 547,551 ---- #p1.addAddressJoiner2(a) AddressJoiner2.new(zip='00000', personJoiner2=p2) ! def test(self): bob = PersonJoiner2.byName('bob') *************** *** 566,570 **** self.assertEqual([i.zip for i in p1.addressJoiner2s], ['33333', '22222', '11111']) ! ######################################## --- 566,570 ---- self.assertEqual([i.zip for i in p1.addressJoiner2s], ['33333', '22222', '11111']) ! ######################################## *************** *** 595,599 **** s3 = Sub(s1.id) self.assertEqual(s1, s3) ! ######################################## --- 595,599 ---- s3 = Sub(s1.id) self.assertEqual(s1, s3) ! ######################################## *************** *** 661,665 **** t.name3 = 0 self.assertEqual(t.name3, 0) ! ######################################## ## String ID test --- 661,666 ---- t.name3 = 0 self.assertEqual(t.name3, 0) ! ! ######################################## ## String ID test *************** *** 678,685 **** """ ! postgresCreate = mysqlCreate sqliteCreate = mysqlCreate firebirdCreate = mysqlCreate ! mysqlDrop = """ DROP TABLE IF EXISTS so_string_id --- 679,692 ---- """ ! postgresCreate = """ ! CREATE TABLE so_string_id ( ! id VARCHAR(50) PRIMARY KEY, ! val TEXT ! ) ! """ ! sqliteCreate = mysqlCreate firebirdCreate = mysqlCreate ! mysqlDrop = """ DROP TABLE IF EXISTS so_string_id *************** *** 823,825 **** coverage.stop() coverModules() ! --- 830,832 ---- coverage.stop() coverModules() ! |
From: <dre...@us...> - 2003-09-24 12:18:21
|
Update of /cvsroot/sqlobject/SQLObject/SQLObject In directory sc8-pr-cvs1:/tmp/cvs-serv2752/SQLObject Modified Files: SQLObject.py __init__.py Log Message: Mostly whitespace and a fix for postgreSQLCreate Index: SQLObject.py =================================================================== RCS file: /cvsroot/sqlobject/SQLObject/SQLObject/SQLObject.py,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** SQLObject.py 7 Sep 2003 23:36:08 -0000 1.57 --- SQLObject.py 24 Sep 2003 12:18:15 -0000 1.58 *************** *** 1175,1179 **** - ######################################## ## Utility functions (for external consumption) --- 1175,1178 ---- Index: __init__.py =================================================================== RCS file: /cvsroot/sqlobject/SQLObject/SQLObject/__init__.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** __init__.py 26 May 2003 21:48:54 -0000 1.4 --- __init__.py 24 Sep 2003 12:18:15 -0000 1.5 *************** *** 5,6 **** --- 5,7 ---- from Style import * from Join import * + from include import Validator |
From: <ian...@us...> - 2003-09-09 04:04:05
|
Update of /cvsroot/sqlobject/SQLObject/docs In directory sc8-pr-cvs1:/tmp/cvs-serv13289/docs Modified Files: FAQ.txt Log Message: Updated FAQ about non-integer IDs Index: FAQ.txt =================================================================== RCS file: /cvsroot/sqlobject/SQLObject/docs/FAQ.txt,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FAQ.txt 7 Sep 2003 19:14:43 -0000 1.3 --- FAQ.txt 9 Sep 2003 04:04:02 -0000 1.4 *************** *** 147,156 **** --------------- ! SQLObject requires that you use an integer primary key, usually ! defined in a specific way (``INT PRIMARY KEY AUTO_INCREMENT`` for ! MySQL, for instance, or ``SERIAL PRIMARY KEY`` for PostgreSQL). You ! cannot use strings or other kinds of values. ! This restriction will probably be removed soon. --- 147,178 ---- --------------- ! Yes, you can use non-integer IDs, but only in CVS_ now. ! .. _CVS: http://sqlobject.org/#anonymous-cvs ! ! If you use non-integer IDs, you will not be able to use automatic ! ``CREATE TABLE`` generation (i.e., ``createTable``). You also will ! have to give your own ID values when creating an object, like:: ! ! color = Something.new(id="blue", r=0, b=100, g=0) ! ! IDs are, and always will in future versions, be considered immutable. ! Right now that is not enforced; you can assign to the ``id`` ! attribute. But if you do you'll just mess everything up. This will ! probably be taken away sometime to avoid possibly confusing bugs ! (actually, assigning to ``id`` is almost certain to cause confusing ! bugs). ! ! If you are concerned about enforcing the type of IDs (which can be a ! problem even with integer IDs) you may want to do this:: ! ! def Color(SQLObject): ! def _init(self, id, connection=None): ! id = str(id) ! SQLObject._init(self, id, connection) ! ! Instead of ``str()`` you may use ``int()`` or whatever else you want. ! This will be resolved in a future version when ID column types can be ! declared like other columns. |
From: <ian...@us...> - 2003-09-09 04:03:27
|
Update of /cvsroot/sqlobject/SOWeb/docs In directory sc8-pr-cvs1:/tmp/cvs-serv13162/docs Modified Files: FAQ.html FAQ.txt default.css Log Message: Updated FAQ Index: FAQ.html =================================================================== RCS file: /cvsroot/sqlobject/SOWeb/docs/FAQ.html,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FAQ.html 7 Sep 2003 19:15:46 -0000 1.3 --- FAQ.html 9 Sep 2003 04:03:23 -0000 1.4 *************** *** 272,280 **** <div class="section" id="non-integer-ids"> <h1><a name="non-integer-ids">Non-Integer IDs</a></h1> ! <p>SQLObject requires that you use an integer primary key, usually ! defined in a specific way (<tt class="literal"><span class="pre">INT</span> <span class="pre">PRIMARY</span> <span class="pre">KEY</span> <span class="pre">AUTO_INCREMENT</span></tt> for ! MySQL, for instance, or <tt class="literal"><span class="pre">SERIAL</span> <span class="pre">PRIMARY</span> <span class="pre">KEY</span></tt> for PostgreSQL). You ! cannot use strings or other kinds of values.</p> ! <p>This restriction will probably be removed soon.</p> </div> <div class="section" id="binary-values"> --- 272,299 ---- <div class="section" id="non-integer-ids"> <h1><a name="non-integer-ids">Non-Integer IDs</a></h1> ! <p>Yes, you can use non-integer IDs, but only in <a class="reference" href="http://sqlobject.org/#anonymous-cvs">CVS</a> now.</p> ! <p>If you use non-integer IDs, you will not be able to use automatic ! <tt class="literal"><span class="pre">CREATE</span> <span class="pre">TABLE</span></tt> generation (i.e., <tt class="literal"><span class="pre">createTable</span></tt>). You also will ! have to give your own ID values when creating an object, like:</p> ! <pre class="literal-block"> ! color = Something.new(id="blue", r=0, b=100, g=0) ! </pre> ! <p>IDs are, and always will in future versions, be considered immutable. ! Right now that is not enforced; you can assign to the <tt class="literal"><span class="pre">id</span></tt> ! attribute. But if you do you'll just mess everything up. This will ! probably be taken away sometime to avoid possibly confusing bugs ! (actually, assigning to <tt class="literal"><span class="pre">id</span></tt> is almost certain to cause confusing ! bugs).</p> ! <p>If you are concerned about enforcing the type of IDs (which can be a ! problem even with integer IDs) you may want to do this:</p> ! <pre class="literal-block"> ! def Color(SQLObject): ! def _init(self, id, connection=None): ! id = str(id) ! SQLObject._init(self, id, connection) ! </pre> ! <p>Instead of <tt class="literal"><span class="pre">str()</span></tt> you may use <tt class="literal"><span class="pre">int()</span></tt> or whatever else you want. ! This will be resolved in a future version when ID column types can be ! declared like other columns.</p> </div> <div class="section" id="binary-values"> Index: FAQ.txt =================================================================== RCS file: /cvsroot/sqlobject/SOWeb/docs/FAQ.txt,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FAQ.txt 7 Sep 2003 19:15:46 -0000 1.3 --- FAQ.txt 9 Sep 2003 04:03:23 -0000 1.4 *************** *** 147,156 **** --------------- ! SQLObject requires that you use an integer primary key, usually ! defined in a specific way (``INT PRIMARY KEY AUTO_INCREMENT`` for ! MySQL, for instance, or ``SERIAL PRIMARY KEY`` for PostgreSQL). You ! cannot use strings or other kinds of values. ! This restriction will probably be removed soon. --- 147,178 ---- --------------- ! Yes, you can use non-integer IDs, but only in CVS_ now. ! .. _CVS: http://sqlobject.org/#anonymous-cvs ! ! If you use non-integer IDs, you will not be able to use automatic ! ``CREATE TABLE`` generation (i.e., ``createTable``). You also will ! have to give your own ID values when creating an object, like:: ! ! color = Something.new(id="blue", r=0, b=100, g=0) ! ! IDs are, and always will in future versions, be considered immutable. ! Right now that is not enforced; you can assign to the ``id`` ! attribute. But if you do you'll just mess everything up. This will ! probably be taken away sometime to avoid possibly confusing bugs ! (actually, assigning to ``id`` is almost certain to cause confusing ! bugs). ! ! If you are concerned about enforcing the type of IDs (which can be a ! problem even with integer IDs) you may want to do this:: ! ! def Color(SQLObject): ! def _init(self, id, connection=None): ! id = str(id) ! SQLObject._init(self, id, connection) ! ! Instead of ``str()`` you may use ``int()`` or whatever else you want. ! This will be resolved in a future version when ID column types can be ! declared like other columns. Index: default.css =================================================================== RCS file: /cvsroot/sqlobject/SOWeb/docs/default.css,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 |
From: <ian...@us...> - 2003-09-07 23:37:34
|
Update of /cvsroot/sqlobject/SQLObject/SQLObject In directory sc8-pr-cvs1:/tmp/cvs-serv14660/SQLObject Modified Files: DBConnection.py SQLObject.py Log Message: Allow non-integer IDs Index: DBConnection.py =================================================================== RCS file: /cvsroot/sqlobject/SQLObject/SQLObject/DBConnection.py,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** DBConnection.py 7 Sep 2003 07:25:58 -0000 1.46 --- DBConnection.py 7 Sep 2003 23:36:08 -0000 1.47 *************** *** 152,157 **** return Transaction(self) ! def queryInsertID(self, table, idName, names, values): ! return self._runWithConnection(self._queryInsertID, table, idName, names, values) def _iterSelect(self, conn, select, withConnection=None, --- 152,157 ---- return Transaction(self) ! def queryInsertID(self, table, idName, id, names, values): ! return self._runWithConnection(self._queryInsertID, table, idName, id, names, values) def _iterSelect(self, conn, select, withConnection=None, *************** *** 373,379 **** return self._dbConnection._queryOne(self._connection, s) ! def queryInsertID(self, table, idName, names, values): return self._dbConnection._queryInsertID( ! self._connection, table, idName, names, values) def iterSelect(self, select): --- 373,379 ---- return self._dbConnection._queryOne(self._connection, s) ! def queryInsertID(self, table, idName, id, names, values): return self._dbConnection._queryInsertID( ! self._connection, table, idName, id, names, values) def iterSelect(self, select): *************** *** 439,449 **** user=self.user, passwd=self.passwd) ! def _queryInsertID(self, conn, table, idName, names, values): c = conn.cursor() q = self._insertSQL(table, names, values) if self.debug: self.printDebug(conn, q, 'QueryIns') c.execute(q) ! id = c.insert_id() if self.debugOutput: self.printDebug(conn, id, 'QueryIns', 'result') --- 439,453 ---- user=self.user, passwd=self.passwd) ! def _queryInsertID(self, conn, table, idName, id, names, values): c = conn.cursor() + if id is not None: + names = [idName] + names + values = [id] + values q = self._insertSQL(table, names, values) if self.debug: self.printDebug(conn, q, 'QueryIns') c.execute(q) ! if id is None: ! id = c.insert_id() if self.debugOutput: self.printDebug(conn, id, 'QueryIns', 'result') *************** *** 558,570 **** return conn ! def _queryInsertID(self, conn, table, idName, names, values): c = conn.cursor() q = self._insertSQL(table, names, values) if self.debug: self.printDebug(conn, q, 'QueryIns') c.execute(q) ! c.execute('SELECT %s FROM %s WHERE oid = %s' ! % (idName, table, c.lastoid())) ! id = c.fetchone()[0] if self.debugOutput: self.printDebug(conn, id, 'QueryIns', 'result') --- 562,578 ---- return conn ! def _queryInsertID(self, conn, table, idName, id, names, values): c = conn.cursor() + if id is not None: + names = [idName] + names + values = [id] + values q = self._insertSQL(table, names, values) if self.debug: self.printDebug(conn, q, 'QueryIns') c.execute(q) ! if id is None: ! c.execute('SELECT %s FROM %s WHERE oid = %s' ! % (idName, table, c.lastoid())) ! id = c.fetchone()[0] if self.debugOutput: self.printDebug(conn, id, 'QueryIns', 'result') *************** *** 682,687 **** return self._conn ! def _queryInsertID(self, conn, table, idName, names, values): c = conn.cursor() q = self._insertSQL(table, names, values) if self.debug: --- 690,698 ---- return self._conn ! def _queryInsertID(self, conn, table, idName, id, names, values): c = conn.cursor() + if id is not None: + names = [idName] + names + values = [id] + values q = self._insertSQL(table, names, values) if self.debug: *************** *** 689,693 **** c.execute(q) # lastrowid is a DB-API extension from "PEP 0249": ! id = int(c.lastrowid) if self.debugOutput: self.printDebug(conn, id, 'QueryIns', 'result') --- 700,705 ---- c.execute(q) # lastrowid is a DB-API extension from "PEP 0249": ! if id is None: ! id = int(c.lastrowid) if self.debugOutput: self.printDebug(conn, id, 'QueryIns', 'result') *************** *** 748,761 **** ) ! def _queryInsertID(self, conn, table, idName, names, values): """Firebird uses 'generators' to create new ids for a table. The users needs to create a generator named GEN_<tablename> for each table this method to work.""" ! row = self.queryOne('SELECT gen_id(GEN_%s,1) FROM rdb$database' ! % table) ! new_key = row[0] ! names.append('ID') ! values.append(new_key) qry = self._insertSQL(table, names, values) if self.debug: --- 760,774 ---- ) ! def _queryInsertID(self, conn, table, idName, id, names, values): """Firebird uses 'generators' to create new ids for a table. The users needs to create a generator named GEN_<tablename> for each table this method to work.""" ! if id is None: ! row = self.queryOne('SELECT gen_id(GEN_%s,1) FROM rdb$database' ! % table) ! id = row[0] ! names = [idName] + names ! values = [id] + values qry = self._insertSQL(table, names, values) if self.debug: *************** *** 763,768 **** self.query(qry) if self.debugOutput: ! self.printDebug(conn, new_key, 'QueryIns', 'result') ! return new_key def _queryAddLimitOffset(self, query, start, end): --- 776,781 ---- self.query(qry) if self.debugOutput: ! self.printDebug(conn, id, 'QueryIns', 'result') ! return id def _queryAddLimitOffset(self, query, start, end): *************** *** 840,845 **** """ ! def queryInsertID(self, table, idName, names, values): ! id = self._newID(table) self._saveDict(table, id, dict(zip(names, values))) return id --- 853,859 ---- """ ! def queryInsertID(self, table, idName, id, names, values): ! if id is None: ! id = self._newID(table) self._saveDict(table, id, dict(zip(names, values))) return id Index: SQLObject.py =================================================================== RCS file: /cvsroot/sqlobject/SQLObject/SQLObject/SQLObject.py,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** SQLObject.py 7 Sep 2003 22:35:09 -0000 1.56 --- SQLObject.py 7 Sep 2003 23:36:08 -0000 1.57 *************** *** 817,820 **** --- 817,826 ---- inst = cls(CreateNewSQLObject) + if kw.has_key('id'): + id = kw['id'] + del kw['id'] + else: + id = None + # First we do a little fix-up on the keywords we were # passed: *************** *** 862,870 **** # Then we finalize the process: ! inst._SO_finishCreate() return inst new = classmethod(new) ! def _SO_finishCreate(self): # Here's where an INSERT is finalized. # These are all the column values that were supposed --- 868,876 ---- # Then we finalize the process: ! inst._SO_finishCreate(id) return inst new = classmethod(new) ! def _SO_finishCreate(self, id=None): # Here's where an INSERT is finalized. # These are all the column values that were supposed *************** *** 884,888 **** # non-standard. id = self._connection.queryInsertID(self._table, self._idName, ! names, values) cache = self._connection.cache cache.created(id, self.__class__, self) --- 890,894 ---- # non-standard. id = self._connection.queryInsertID(self._table, self._idName, ! id, names, values) cache = self._connection.cache cache.created(id, self.__class__, self) |
From: <ian...@us...> - 2003-09-07 23:37:32
|
Update of /cvsroot/sqlobject/SQLObject/tests In directory sc8-pr-cvs1:/tmp/cvs-serv14660/tests Modified Files: SQLObjectTest.py test.py Log Message: Allow non-integer IDs Index: SQLObjectTest.py =================================================================== RCS file: /cvsroot/sqlobject/SQLObject/tests/SQLObjectTest.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** SQLObjectTest.py 7 Sep 2003 07:05:09 -0000 1.14 --- SQLObjectTest.py 7 Sep 2003 23:36:08 -0000 1.15 *************** *** 95,100 **** if hasattr(c, '%sDrop' % self.databaseName): if __connection__.tableExists(c._table): ! __connection__.query( ! getattr(c, '%sDrop' % self.databaseName)) elif hasattr(c, 'drop'): __connection__.query(c.drop) --- 95,103 ---- if hasattr(c, '%sDrop' % self.databaseName): if __connection__.tableExists(c._table): ! sql = getattr(c, '%sDrop' % self.databaseName) ! #if self.debugInserts: ! # print sql ! __connection__.query(sql) ! elif hasattr(c, 'drop'): __connection__.query(c.drop) *************** *** 104,109 **** if hasattr(c, '%sCreate' % self.databaseName): if not __connection__.tableExists(c._table): ! __connection__.query( ! getattr(c, '%sCreate' % self.databaseName)) elif hasattr(c, 'create'): __connection__.query(c.create) --- 107,115 ---- if hasattr(c, '%sCreate' % self.databaseName): if not __connection__.tableExists(c._table): ! sql = getattr(c, '%sCreate' % self.databaseName) ! #if self.debugInserts: ! # print sql ! __connection__.query(sql) ! elif hasattr(c, 'create'): __connection__.query(c.create) *************** *** 127,131 **** global __connection__ conn = globals()[t + "Connection"]() ! SQLObject.databaseName = t __connection__ = conn --- 133,137 ---- global __connection__ conn = globals()[t + "Connection"]() ! SQLObjectTest.databaseName = t __connection__ = conn Index: test.py =================================================================== RCS file: /cvsroot/sqlobject/SQLObject/tests/test.py,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** test.py 7 Sep 2003 22:35:09 -0000 1.27 --- test.py 7 Sep 2003 23:36:08 -0000 1.28 *************** *** 662,665 **** --- 662,708 ---- self.assertEqual(t.name3, 0) + ######################################## + ## String ID test + ######################################## + + class SOStringID(SQLObject): + + _table = 'so_string_id' + val = StringCol(alternateID=True) + + mysqlCreate = """ + CREATE TABLE IF NOT EXISTS so_string_id ( + id VARCHAR(50) PRIMARY KEY, + val TEXT + ) + """ + + postgresCreate = mysqlCreate + sqliteCreate = mysqlCreate + firebirdCreate = mysqlCreate + + mysqlDrop = """ + DROP TABLE IF EXISTS so_string_id + """ + + postgresDrop = """ + DROP TABLE so_string_id + """ + + sqliteDrop = postgresDrop + firebirdDrop = postgresDrop + + class StringIDTest(SQLObjectTest): + + classes = [SOStringID] + + def testStringID(self): + t = SOStringID.new(id='hey', val='whatever') + t2 = SOStringID.byVal('whatever') + self.assertEqual(t, t2) + t3 = SOStringID.new(id='you', val='nowhere') + t4 = SOStringID('you') + self.assertEqual(t3, t4) + ######################################## |
From: <ian...@us...> - 2003-09-07 22:35:17
|
Update of /cvsroot/sqlobject/SQLObject/SQLObject In directory sc8-pr-cvs1:/tmp/cvs-serv5224/SQLObject Modified Files: Col.py SQLObject.py Log Message: Added conversion/validation to columns Index: Col.py =================================================================== RCS file: /cvsroot/sqlobject/SQLObject/SQLObject/Col.py,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** Col.py 6 Sep 2003 02:33:17 -0000 1.25 --- Col.py 7 Sep 2003 22:35:09 -0000 1.26 *************** *** 6,9 **** --- 6,10 ---- import re import Constraints + from include import Validator NoDefault = SQLBuilder.NoDefault *************** *** 31,39 **** unique=NoDefault, sqlType=None, ! columnDef=None): ! # This isn't strictly true, since we *could* use backquotes ! # around column names, but why would anyone *want* to ! # use a name like that? # @@: I suppose we could actually add backquotes to the # dbName if we needed to... --- 32,42 ---- unique=NoDefault, sqlType=None, ! columnDef=None, ! validator=None, ! immutable=False): ! # This isn't strictly true, since we *could* use backquotes or ! # " or something (database-specific) around column names, but ! # why would anyone *want* to use a name like that? # @@: I suppose we could actually add backquotes to the # dbName if we needed to... *************** *** 45,48 **** --- 48,53 ---- self.columnDef = columnDef + self.immutable = immutable + if type(constraints) not in (type([]), type(())): constraints = [constraints] *************** *** 97,100 **** --- 102,112 ---- else: self.foreignName = None + + if validator: + self.toPython = validator.toPython + self.fromPython = validator.fromPython + else: + self.toPython = None + self.fromPython = None def autoConstraints(self): Index: SQLObject.py =================================================================== RCS file: /cvsroot/sqlobject/SQLObject/SQLObject/SQLObject.py,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** SQLObject.py 7 Sep 2003 18:06:21 -0000 1.55 --- SQLObject.py 7 Sep 2003 22:35:09 -0000 1.56 *************** *** 427,434 **** # no superclass that defines the database access. if cls._cacheValues: - # We create a method here, which is just a function # that takes "self" as the first argument. getter = eval('lambda self: self._SO_loadValue(%s)' % repr(instanceName(name))) else: # If we aren't caching values, we just call the --- 427,434 ---- # no superclass that defines the database access. if cls._cacheValues: # We create a method here, which is just a function # that takes "self" as the first argument. getter = eval('lambda self: self._SO_loadValue(%s)' % repr(instanceName(name))) + else: # If we aren't caching values, we just call the *************** *** 452,466 **** # those methods themself. ! # We start by just using the _SO_setValue method ! setter = eval('lambda self, val: self._SO_setValue(%s, val)' % repr(name)) ! setattr(cls, rawSetterName(name), setter) ! # Then do the aliasing ! if not hasattr(cls, setterName(name)): ! setattr(cls, setterName(name), setter) ! # We keep track of setters that haven't been ! # overridden, because we can combine these ! # set columns into one SQL UPDATE query. ! cls._SO_plainSetters[name] = 1 ! ################################################## --- 452,467 ---- # those methods themself. ! if not column.immutable: ! # We start by just using the _SO_setValue method ! setter = eval('lambda self, val: self._SO_setValue(%s, val, self.%s)' % (repr(name), '_SO_toPython_%s' % name)) ! setattr(cls, '_SO_toPython_%s' % name, column.toPython) ! setattr(cls, rawSetterName(name), setter) ! # Then do the aliasing ! if not hasattr(cls, setterName(name)): ! setattr(cls, setterName(name), setter) ! # We keep track of setters that haven't been ! # overridden, because we can combine these ! # set columns into one SQL UPDATE query. ! cls._SO_plainSetters[name] = 1 ################################################## *************** *** 490,500 **** cls._SO_plainForeignGetters[name[:-2]] = 1 ! # The setter just gets the ID of the object, ! # and then sets the real column. ! setter = eval('lambda self, val: setattr(self, %s, self._SO_getID(val))' % (repr(name))) ! setattr(cls, rawSetterName(name)[:-2], setter) ! if not hasattr(cls, setterName(name)[:-2]): ! setattr(cls, setterName(name)[:-2], setter) ! cls._SO_plainForeignSetters[name[:-2]] = 1 # We'll need to put in a real reference at --- 491,502 ---- cls._SO_plainForeignGetters[name[:-2]] = 1 ! if not column.immutable: ! # The setter just gets the ID of the object, ! # and then sets the real column. ! setter = eval('lambda self, val: setattr(self, %s, self._SO_getID(val))' % (repr(name))) ! setattr(cls, rawSetterName(name)[:-2], setter) ! if not hasattr(cls, setterName(name)[:-2]): ! setattr(cls, setterName(name)[:-2], setter) ! cls._SO_plainForeignSetters[name[:-2]] = 1 # We'll need to put in a real reference at *************** *** 659,662 **** --- 661,666 ---- self._SO_perConnection = True + self._SO_validatorState = SQLObjectState(self) + if not selectResults: dbNames = [col.dbName for col in self._SO_columns] *************** *** 717,721 **** self._SO_writeLock.release() ! def _SO_setValue(self, name, value): # This is the place where we actually update the # database. --- 721,725 ---- self._SO_writeLock.release() ! def _SO_setValue(self, name, value, toPython): # This is the place where we actually update the # database. *************** *** 725,728 **** --- 729,734 ---- # the parts are set. So we just keep them in a # dictionary until later: + if toPython: + value = toPython(value, self._SO_validatorState) if self._SO_creating: self._SO_createValues[name] = value *************** *** 770,773 **** --- 776,781 ---- def _SO_selectInit(self, row): for col, colValue in zip(self._SO_columns, row): + if col.fromPython: + colValue = col.fromPython(colValue, self._SO_validatorState) setattr(self, instanceName(col.name), colValue) *************** *** 778,786 **** # @@: do we really need this lock? #self._SO_writeLock.acquire() ! results = self._connection._SO_selectOne(self, [self._SO_columnDict[name].dbName]) #self._SO_writeLock.release() 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): --- 786,798 ---- # @@: do we really need this lock? #self._SO_writeLock.acquire() ! column = self._SO_columnDict[name] ! results = self._connection._SO_selectOne(self, [column.dbName]) #self._SO_writeLock.release() assert results != None, "%s with id %s is not in the database" \ % (self.__class__.__name__, self.id) ! value = results[0] ! if column.toPython: ! value = column.toPython(value, self._SO_validatorState) ! return value def _SO_foreignKey(self, id, joinClass): *************** *** 1150,1154 **** --- 1162,1170 ---- return count + class SQLObjectState(object): + def __init__(self, soObject): + self.soObject = soObject + self.protocol = 'sql' |
From: <ian...@us...> - 2003-09-07 22:35:17
|
Update of /cvsroot/sqlobject/SQLObject/SQLObject/include In directory sc8-pr-cvs1:/tmp/cvs-serv5224/SQLObject/include Added Files: Validator.py __init__.py Log Message: Added conversion/validation to columns --- NEW FILE: Validator.py --- ## FormEncode, a Form processor ## Copyright (C) 2003, Ian Bicking <ia...@co...> ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public ## License as published by the Free Software Foundation; either ## version 2.1 of the License, or (at your option) any later version. ## ## This library is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## Lesser General Public License for more details. ## ## You should have received a copy of the GNU Lesser General Public ## License along with this library; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## ## NOTE: In the context of the Python environment, I interpret "dynamic ## linking" as importing -- thus the LGPL applies to the contents of [...1000 lines suppressed...] ('52', 16), ('53', 16), ('54', 16), ('55', 16)], "discover": [('6011', 16)], "amex": [('34', 15), ('37', 15)], "dinersclub": [('300', 14), ('301', 14), ('302', 14), ('303', 14), ('304', 14), ('305', 14), ('36', 14), ('38', 14)], "jcb": [('3', 16), ('2131', 15), ('1800', 15)], } --- NEW FILE: __init__.py --- """ This directory includes third-party software, or software that is distributed separately, that may not be installed on this computer. """ |
From: <ian...@us...> - 2003-09-07 22:35:17
|
Update of /cvsroot/sqlobject/SQLObject In directory sc8-pr-cvs1:/tmp/cvs-serv5224 Modified Files: setup.py Log Message: Added conversion/validation to columns Index: setup.py =================================================================== RCS file: /cvsroot/sqlobject/SQLObject/setup.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** setup.py 5 Jul 2003 03:55:22 -0000 1.11 --- setup.py 7 Sep 2003 22:35:09 -0000 1.12 *************** *** 31,35 **** url="http://sqlobject.org", license="LGPL", ! packages=["SQLObject"], download_url="http://prdownloads.sourceforge.net/sqlobject/SQLObject-0.4.tar.gz?download") --- 31,35 ---- url="http://sqlobject.org", license="LGPL", ! packages=["SQLObject", "SQLObject.include"], download_url="http://prdownloads.sourceforge.net/sqlobject/SQLObject-0.4.tar.gz?download") |
From: <ian...@us...> - 2003-09-07 22:35:16
|
Update of /cvsroot/sqlobject/SQLObject/tests In directory sc8-pr-cvs1:/tmp/cvs-serv5224/tests Modified Files: test.py Log Message: Added conversion/validation to columns Index: test.py =================================================================== RCS file: /cvsroot/sqlobject/SQLObject/tests/test.py,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** test.py 7 Sep 2003 19:14:07 -0000 1.26 --- test.py 7 Sep 2003 22:35:09 -0000 1.27 *************** *** 18,21 **** --- 18,22 ---- from SQLObjectTest import * from SQLObject import * + from SQLObject.include import Validator from mx import DateTime *************** *** 623,626 **** --- 624,665 ---- b.sync() self.assertEqual(b.name, 'bobby') + + ######################################## + ## Validation/conversion + ######################################## + + class SOValidation(SQLObject): + + name = StringCol(validator=Validator.PlainText(), default='x') + name2 = StringCol(validator=Validator.ConfirmType(str), default='y') + name3 = StringCol(validator=Validator.Wrapper(toPython=int), default=100) + + class ValidationTest(SQLObjectTest): + + classes = [SOValidation] + + def testValidate(self): + t = SOValidation.new(name='hey') + self.assertRaises(Validator.InvalidField, setattr, t, + 'name', '!!!') + t.name = 'you' + + def testConfirmType(self): + t = SOValidation.new(name2='hey') + self.assertRaises(Validator.InvalidField, setattr, t, + 'name2', 1) + t.name2 = 'you' + + def testWrapType(self): + t = SOValidation.new(name3=1) + self.assertRaises(Validator.InvalidField, setattr, t, + 'name3', 'x') + t.name3 = 1L + self.assertEqual(t.name3, 1) + t.name3 = '1' + self.assertEqual(t.name3, 1) + t.name3 = 0 + self.assertEqual(t.name3, 0) + ######################################## |
From: <ian...@us...> - 2003-09-07 22:34:44
|
Update of /cvsroot/sqlobject/SQLObject/SQLObject/include In directory sc8-pr-cvs1:/tmp/cvs-serv5181/SQLObject/include Log Message: Directory /cvsroot/sqlobject/SQLObject/SQLObject/include added to the repository |
From: <ian...@us...> - 2003-09-07 19:15:51
|
Update of /cvsroot/sqlobject/SOWeb/docs In directory sc8-pr-cvs1:/tmp/cvs-serv1774/docs Modified Files: FAQ.html FAQ.txt default.css Log Message: Updated docs Index: FAQ.html =================================================================== RCS file: /cvsroot/sqlobject/SOWeb/docs/FAQ.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FAQ.html 7 Sep 2003 18:21:38 -0000 1.2 --- FAQ.html 7 Sep 2003 19:15:46 -0000 1.3 *************** *** 22,25 **** --- 22,26 ---- <li><a class="reference" href="#composite-compound-attributes" id="id5" name="id5">Composite/Compound Attributes</a></li> <li><a class="reference" href="#non-integer-ids" id="id6" name="id6">Non-Integer IDs</a></li> + <li><a class="reference" href="#binary-values" id="id7" name="id7">Binary Values</a></li> </ul> </div> *************** *** 276,279 **** --- 277,316 ---- cannot use strings or other kinds of values.</p> <p>This restriction will probably be removed soon.</p> + </div> + <div class="section" id="binary-values"> + <h1><a name="binary-values">Binary Values</a></h1> + <p>Binary values can be difficult to store in databases, as SQL doesn't + have a widely-implemented way to express binaries as literals, and + there's differing support in database.</p> + <p>A possible way to keep this data in a database is by using encoding. + Base 64 is a good encoding, reasonably compact but also safe. As + an example, imagine you want to store images in the database:</p> + + <pre class="literal-block"><tt><span class="keyword">class</span> <span class="function">Image</span><span class="symbol">(</span><span class="normal">SQLObject</span><span class="symbol">)</span><span class="symbol">:</span> + + <span class="normal">data</span> <span class="symbol">=</span> <span class="function">StringCol</span><span class="symbol">(</span><span class="symbol">)</span> + <span class="normal">height</span> <span class="symbol">=</span> <span class="function">IntCol</span><span class="symbol">(</span><span class="symbol">)</span> + <span class="normal">width</span> <span class="symbol">=</span> <span class="function">IntCol</span><span class="symbol">(</span><span class="symbol">)</span> + + <span class="keyword">def</span> <span class="function">_set_data</span><span class="symbol">(</span><span class="normal">self</span><span class="symbol">,</span> <span class="normal">value</span><span class="symbol">)</span><span class="symbol">:</span> + <span class="normal">self</span><span class="symbol">.</span><span class="function">_SO_set_data</span><span class="symbol">(</span><span class="normal">value</span><span class="symbol">.</span><span class="function">encode</span><span class="symbol">(</span><span class="string">'base64'</span><span class="symbol">)</span><span class="symbol">)</span> + + <span class="keyword">def</span> <span class="function">_get_data</span><span class="symbol">(</span><span class="normal">self</span><span class="symbol">,</span> <span class="normal">value</span><span class="symbol">)</span><span class="symbol">:</span> + <span class="keyword">return</span> <span class="normal">self</span><span class="symbol">.</span><span class="function">_SO_get_data</span><span class="symbol">(</span><span class="symbol">)</span><span class="symbol">.</span><span class="function">decode</span><span class="symbol">(</span><span class="string">'base64'</span><span class="symbol">)</span> + </tt></pre> + <p>SQLite does not respect backslash quoting, so for instance <tt class="literal"><span class="pre">\n</span></tt> is + not interpreted as a newline. For the moment there's no resolution, + and this will mess up your base64-encoded values. As a workaround:</p> + + <pre class="literal-block"><tt><span class="keyword">class</span> <span class="function">Image</span><span class="symbol">(</span><span class="normal">SQLObject</span><span class="symbol">)</span><span class="symbol">:</span> + <span class="normal">data</span> <span class="symbol">=</span> <span class="function">StringCol</span><span class="symbol">(</span><span class="symbol">)</span> + + <span class="keyword">def</span> <span class="function">_set_data</span><span class="symbol">(</span><span class="normal">self</span><span class="symbol">,</span> <span class="normal">value</span><span class="symbol">)</span><span class="symbol">:</span> + <span class="comment"># base64 just ignores whitespace, so we can get rid of \n's</span> + <span class="normal">self</span><span class="symbol">.</span><span class="function">_SO_set_data</span><span class="symbol">(</span><span class="normal">value</span><span class="symbol">.</span><span class="function">encode</span><span class="symbol">(</span><span class="string">'base64'</span><span class="symbol">)</span><span class="symbol">.</span><span class="function">replace</span><span class="symbol">(</span><span class="string">'\n'</span><span class="symbol">,</span> <span class="string">''</span><span class="symbol">)</span><span class="symbol">)</span> + + <span class="keyword">def</span> <span class="function">_get_data</span><span class="symbol">(</span><span class="normal">self</span><span class="symbol">)</span><span class="symbol">:</span> + <span class="keyword">return</span> <span class="normal">self</span><span class="symbol">.</span><span class="function">_SO_get_data</span><span class="symbol">(</span><span class="symbol">)</span><span class="symbol">.</span><span class="function">decode</span><span class="symbol">(</span><span class="string">'base64'</span><span class="symbol">)</span> + </tt></pre> </div> </div> Index: FAQ.txt =================================================================== RCS file: /cvsroot/sqlobject/SOWeb/docs/FAQ.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FAQ.txt 7 Sep 2003 18:21:38 -0000 1.2 --- FAQ.txt 7 Sep 2003 19:15:46 -0000 1.3 *************** *** 154,155 **** --- 154,177 ---- This restriction will probably be removed soon. + + Binary Values + ------------- + + Binary values can be difficult to store in databases, as SQL doesn't + have a widely-implemented way to express binaries as literals, and + there's differing support in database. + + A possible way to keep this data in a database is by using encoding. + Base 64 is a good encoding, reasonably compact but also safe. As + an example, imagine you want to store images in the database: + + .. raw:: html + :file: ../examples/snippets/image-binary.html + + SQLite does not respect backslash quoting, so for instance ``\n`` is + not interpreted as a newline. For the moment there's no resolution, + and this will mess up your base64-encoded values. As a workaround: + + .. raw:: html + :file: ../examples/snippets/image-binary-sqlite.html + Index: default.css =================================================================== RCS file: /cvsroot/sqlobject/SOWeb/docs/default.css,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 |
From: <ian...@us...> - 2003-09-07 19:14:46
|
Update of /cvsroot/sqlobject/SQLObject/examples In directory sc8-pr-cvs1:/tmp/cvs-serv1609/examples Modified Files: codebits.py Log Message: Added FAQ about binary files Index: codebits.py =================================================================== RCS file: /cvsroot/sqlobject/SQLObject/examples/codebits.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** codebits.py 21 Aug 2003 05:02:17 -0000 1.2 --- codebits.py 7 Sep 2003 19:14:43 -0000 1.3 *************** *** 221,222 **** --- 221,248 ---- longitude = property(_get_longitude, set_longitude) ## end snippet + + ## Snippet "image-binary" + class Image(SQLObject): + + data = StringCol() + height = IntCol() + width = IntCol() + + def _set_data(self, value): + self._SO_set_data(value.encode('base64')) + + def _get_data(self, value): + return self._SO_get_data().decode('base64') + ## end snippet + + ## Snippet "image-binary-sqlite" + class Image(SQLObject): + data = StringCol() + + def _set_data(self, value): + # base64 just ignores whitespace, so we can get rid of \n's + self._SO_set_data(value.encode('base64').replace('\n', '')) + + def _get_data(self): + return self._SO_get_data().decode('base64') + ## end snippet |
From: <ian...@us...> - 2003-09-07 19:14:46
|
Update of /cvsroot/sqlobject/SQLObject/docs In directory sc8-pr-cvs1:/tmp/cvs-serv1609/docs Modified Files: FAQ.txt Log Message: Added FAQ about binary files Index: FAQ.txt =================================================================== RCS file: /cvsroot/sqlobject/SQLObject/docs/FAQ.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FAQ.txt 7 Sep 2003 18:19:25 -0000 1.2 --- FAQ.txt 7 Sep 2003 19:14:43 -0000 1.3 *************** *** 154,155 **** --- 154,177 ---- This restriction will probably be removed soon. + + Binary Values + ------------- + + Binary values can be difficult to store in databases, as SQL doesn't + have a widely-implemented way to express binaries as literals, and + there's differing support in database. + + A possible way to keep this data in a database is by using encoding. + Base 64 is a good encoding, reasonably compact but also safe. As + an example, imagine you want to store images in the database: + + .. raw:: html + :file: ../examples/snippets/image-binary.html + + SQLite does not respect backslash quoting, so for instance ``\n`` is + not interpreted as a newline. For the moment there's no resolution, + and this will mess up your base64-encoded values. As a workaround: + + .. raw:: html + :file: ../examples/snippets/image-binary-sqlite.html + |
From: <ian...@us...> - 2003-09-07 19:14:11
|
Update of /cvsroot/sqlobject/SQLObject/tests In directory sc8-pr-cvs1:/tmp/cvs-serv1387/tests Modified Files: .cvsignore test.py Log Message: Ignore coverage data file. But also delete coverage data file after generating reports Index: .cvsignore =================================================================== RCS file: /cvsroot/sqlobject/SQLObject/tests/.cvsignore,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** .cvsignore 7 Sep 2003 19:12:43 -0000 1.2 --- .cvsignore 7 Sep 2003 19:14:07 -0000 1.3 *************** *** 1,2 **** --- 1,3 ---- *.pyc *,cover + .coverage Index: test.py =================================================================== RCS file: /cvsroot/sqlobject/SQLObject/tests/test.py,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** test.py 7 Sep 2003 18:07:11 -0000 1.25 --- test.py 7 Sep 2003 19:14:07 -0000 1.26 *************** *** 644,647 **** --- 644,648 ---- if modFile.startswith(here) or modFile.startswith(there): writeCoverage(mod, there, os.path.join(here, 'SQLObject')) + coverage.erase() sys.stdout.write('done.\n') |
From: <ian...@us...> - 2003-09-07 19:12:47
|
Update of /cvsroot/sqlobject/SQLObject/SQLObject In directory sc8-pr-cvs1:/tmp/cvs-serv1139/SQLObject Modified Files: .cvsignore Log Message: Ignore ,cover files Index: .cvsignore =================================================================== RCS file: /cvsroot/sqlobject/SQLObject/SQLObject/.cvsignore,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** .cvsignore 26 Feb 2003 23:59:41 -0000 1.1.1.1 --- .cvsignore 7 Sep 2003 19:12:43 -0000 1.2 *************** *** 1 **** --- 1,2 ---- *.pyc + *,cover |
From: <ian...@us...> - 2003-09-07 19:12:47
|
Update of /cvsroot/sqlobject/SQLObject/examples In directory sc8-pr-cvs1:/tmp/cvs-serv1139/examples Modified Files: .cvsignore Log Message: Ignore ,cover files Index: .cvsignore =================================================================== RCS file: /cvsroot/sqlobject/SQLObject/examples/.cvsignore,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** .cvsignore 26 Feb 2003 23:59:43 -0000 1.1.1.1 --- .cvsignore 7 Sep 2003 19:12:43 -0000 1.2 *************** *** 1 **** --- 1,2 ---- *.pyc + *,cover |
From: <ian...@us...> - 2003-09-07 19:12:47
|
Update of /cvsroot/sqlobject/SQLObject/tests In directory sc8-pr-cvs1:/tmp/cvs-serv1139/tests Modified Files: .cvsignore Log Message: Ignore ,cover files Index: .cvsignore =================================================================== RCS file: /cvsroot/sqlobject/SQLObject/tests/.cvsignore,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** .cvsignore 2 Mar 2003 23:11:58 -0000 1.1 --- .cvsignore 7 Sep 2003 19:12:43 -0000 1.2 *************** *** 1 **** --- 1,2 ---- *.pyc + *,cover |
From: <ian...@us...> - 2003-09-07 19:11:39
|
Update of /cvsroot/sqlobject/SQLObject In directory sc8-pr-cvs1:/tmp/cvs-serv801 Modified Files: .cvsignore Log Message: Ignore coverage files Index: .cvsignore =================================================================== RCS file: /cvsroot/sqlobject/SQLObject/.cvsignore,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** .cvsignore 7 Apr 2003 01:13:52 -0000 1.2 --- .cvsignore 7 Sep 2003 19:11:37 -0000 1.3 *************** *** 4,5 **** --- 4,6 ---- MANIFEST data + *,cover |
From: <ian...@us...> - 2003-09-07 18:21:42
|
Update of /cvsroot/sqlobject/SOWeb/docs In directory sc8-pr-cvs1:/tmp/cvs-serv24167/docs Modified Files: Authors.html Authors.txt FAQ.html FAQ.txt default.css Log Message: Updated docs Index: Authors.html =================================================================== RCS file: /cvsroot/sqlobject/SOWeb/docs/Authors.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Authors.html 21 Aug 2003 05:06:58 -0000 1.2 --- Authors.html 7 Sep 2003 18:21:38 -0000 1.3 *************** *** 19,22 **** --- 19,23 ---- <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> + <li>James Ralston <<a class="reference" href="mailto:jralston@hotmail.com">jralston@hotmail.com</a>></li> </ul> </div> Index: Authors.txt =================================================================== RCS file: /cvsroot/sqlobject/SOWeb/docs/Authors.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Authors.txt 5 Jul 2003 04:41:00 -0000 1.1 --- Authors.txt 7 Sep 2003 18:21:38 -0000 1.2 *************** *** 11,12 **** --- 11,13 ---- * David M. Cook <da...@da...> * Luke Opperman <lu...@me...> + * James Ralston <jra...@ho...> Index: FAQ.html =================================================================== RCS file: /cvsroot/sqlobject/SOWeb/docs/FAQ.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FAQ.html 21 Aug 2003 05:06:58 -0000 1.1 --- FAQ.html 7 Sep 2003 18:21:38 -0000 1.2 *************** *** 21,24 **** --- 21,25 ---- <li><a class="reference" href="#how-does-inheritance-work" id="id4" name="id4">How Does Inheritance Work?</a></li> <li><a class="reference" href="#composite-compound-attributes" id="id5" name="id5">Composite/Compound Attributes</a></li> + <li><a class="reference" href="#non-integer-ids" id="id6" name="id6">Non-Integer IDs</a></li> </ul> </div> *************** *** 267,270 **** --- 268,279 ---- values, or could be used among several objects that have latitude/longitude columns.</p> + </div> + <div class="section" id="non-integer-ids"> + <h1><a name="non-integer-ids">Non-Integer IDs</a></h1> + <p>SQLObject requires that you use an integer primary key, usually + defined in a specific way (<tt class="literal"><span class="pre">INT</span> <span class="pre">PRIMARY</span> <span class="pre">KEY</span> <span class="pre">AUTO_INCREMENT</span></tt> for + MySQL, for instance, or <tt class="literal"><span class="pre">SERIAL</span> <span class="pre">PRIMARY</span> <span class="pre">KEY</span></tt> for PostgreSQL). You + cannot use strings or other kinds of values.</p> + <p>This restriction will probably be removed soon.</p> </div> </div> Index: FAQ.txt =================================================================== RCS file: /cvsroot/sqlobject/SOWeb/docs/FAQ.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FAQ.txt 21 Aug 2003 05:06:58 -0000 1.1 --- FAQ.txt 7 Sep 2003 18:21:38 -0000 1.2 *************** *** 142,143 **** --- 142,155 ---- values, or could be used among several objects that have latitude/longitude columns. + + + Non-Integer IDs + --------------- + + SQLObject requires that you use an integer primary key, usually + defined in a specific way (``INT PRIMARY KEY AUTO_INCREMENT`` for + MySQL, for instance, or ``SERIAL PRIMARY KEY`` for PostgreSQL). You + cannot use strings or other kinds of values. + + This restriction will probably be removed soon. + Index: default.css =================================================================== RCS file: /cvsroot/sqlobject/SOWeb/docs/default.css,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 |
From: <ian...@us...> - 2003-09-07 18:21:42
|
Update of /cvsroot/sqlobject/SOWeb In directory sc8-pr-cvs1:/tmp/cvs-serv24167 Modified Files: index.html Log Message: Updated docs Index: index.html =================================================================== RCS file: /cvsroot/sqlobject/SOWeb/index.html,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** index.html 21 Aug 2003 05:06:58 -0000 1.8 --- index.html 7 Sep 2003 18:21:38 -0000 1.9 *************** *** 14,23 **** <p class="topic-title"><a name="contents">Contents</a></p> <ul class="simple"> ! <li><a class="reference" href="#introduction" id="id9" name="id9">Introduction</a></li> ! <li><a class="reference" href="#example" id="id10" name="id10">Example</a></li> ! <li><a class="reference" href="#community" id="id11" name="id11">Community</a></li> ! <li><a class="reference" href="#bugs-patches-etc" id="id12" name="id12">Bugs, patches, etc</a></li> ! <li><a class="reference" href="#download" id="id13" name="id13">Download</a></li> ! <li><a class="reference" href="#documentation" id="id14" name="id14">Documentation</a></li> </ul> </div> --- 14,23 ---- <p class="topic-title"><a name="contents">Contents</a></p> <ul class="simple"> ! <li><a class="reference" href="#introduction" id="id10" name="id10">Introduction</a></li> ! <li><a class="reference" href="#example" id="id11" name="id11">Example</a></li> ! <li><a class="reference" href="#community" id="id12" name="id12">Community</a></li> ! <li><a class="reference" href="#bugs-patches-etc" id="id13" name="id13">Bugs, patches, etc</a></li> ! <li><a class="reference" href="#download" id="id14" name="id14">Download</a></li> ! <li><a class="reference" href="#documentation" id="id15" name="id15">Documentation</a></li> </ul> </div> *************** *** 89,93 **** <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 access CVS:</p> <pre class="literal-block"> --- 89,96 ---- <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>The SQLObject mailing list is also available through <a class="reference" href="http://www.gmane.org">Gmane</a>, through ! both a <a class="reference" href="http://news.gmane.org/thread.php?group=gmane.comp.python.sqlobject">web interface</a> or a <a class="reference" href="news://news.gmane.org/gmane.comp.python.sqlobject">NNTP (news) interface</a>. This also is a ! good source for searchable archives.</p> ! <a class="target" id="anonymous-cvs" name="anonymous-cvs"></a><p>If you are tracking changes, keeping up with CVS is helpful. To access CVS:</p> <pre class="literal-block"> *************** *** 113,116 **** --- 116,124 ---- <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> <p><a class="reference" href="http://prdownloads.sourceforge.net/sqlobject/SQLObject-0.4.win32.exe?download">SQLObject-0.4.win32.exe</a></p> + <p>You can also use <a class="reference" href="#anonymous-cvs">anonymous CVS</a> to access the latest files. + However, SourceForge is currently delaying the anonymous CVS servers + by 24 hours, so you won't see the newest code, particularly when a + change is made to CVS specifically to address a problem you are + having. Instead use the <a class="reference" href="http://colorstudy.com/ianb/SQLObject-cvs.tar.bz2">Mostly Live CVS Tarball</a></p> </div> <div class="section" id="documentation"> |
From: <ian...@us...> - 2003-09-07 18:20:01
|
Update of /cvsroot/sqlobject/SOWeb In directory sc8-pr-cvs1:/tmp/cvs-serv23859 Modified Files: index.txt Log Message: Added note about gmane Index: index.txt =================================================================== RCS file: /cvsroot/sqlobject/SOWeb/index.txt,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** index.txt 7 Sep 2003 18:12:02 -0000 1.7 --- index.txt 7 Sep 2003 18:19:58 -0000 1.8 *************** *** 78,81 **** --- 78,89 ---- `Join the mailing list`__ or visit the `sqlobject-discuss archives`_. + The SQLObject mailing list is also available through Gmane_, through + both a `web interface`_ or a `NNTP (news) interface`_. This also is a + good source for searchable archives. + + .. _gmane: http://www.gmane.org + .. _`web interface`: http://news.gmane.org/thread.php?group=gmane.comp.python.sqlobject + .. _`NNTP (news) interface`: news://news.gmane.org/gmane.comp.python.sqlobject + .. __: http://lists.sourceforge.net/lists/listinfo/sqlobject-discuss |
From: <ian...@us...> - 2003-09-07 18:19:30
|
Update of /cvsroot/sqlobject/SQLObject/docs In directory sc8-pr-cvs1:/tmp/cvs-serv23773/docs Modified Files: FAQ.txt Log Message: Added note about non-integer IDs Index: FAQ.txt =================================================================== RCS file: /cvsroot/sqlobject/SQLObject/docs/FAQ.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FAQ.txt 21 Aug 2003 05:02:16 -0000 1.1 --- FAQ.txt 7 Sep 2003 18:19:25 -0000 1.2 *************** *** 142,143 **** --- 142,155 ---- values, or could be used among several objects that have latitude/longitude columns. + + + Non-Integer IDs + --------------- + + SQLObject requires that you use an integer primary key, usually + defined in a specific way (``INT PRIMARY KEY AUTO_INCREMENT`` for + MySQL, for instance, or ``SERIAL PRIMARY KEY`` for PostgreSQL). You + cannot use strings or other kinds of values. + + This restriction will probably be removed soon. + |