FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Two bug in SQLiteConnection.columnsFromSchema() were fixed: use · sqlobject/sqlobject@0560f80 · GitHub

Commit 0560f80

Browse files
committed
Two bug in SQLiteConnection.columnsFromSchema() were fixed: use
sqlmeta.idName instead of 'id'; convert default 'NULL' to None. git-svn-id: http://svn.colorstudy.com/SQLObject/trunk@3885 95a46c32-92d2-0310-94a5-8d71aeb3d4b3
1 parent 0ea3e10 commit 0560f80

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

‎docs/News.txt‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ SQLObject 0.10.6
5353

5454
* Better support for Python 2.6: do not import the deprecated sets module.
5555

56+
* A number of changes ported from `SQLObject 0.9.11`_.
57+
5658
SQLObject 0.10.5
5759
================
5860

@@ -163,6 +165,12 @@ Features & Interface
163165
* Under MySQL, PickleCol no longer used TEXT column types; the smallest
164166
column is now BLOB - it is not possible to create TINYBLOB column.
165167

168+
SQLObject 0.9.11
169+
================
170+
171+
* Two bug in SQLiteConnection.columnsFromSchema() were fixed: use
172+
sqlmeta.idName instead of 'id'; convert default 'NULL' to None.
173+
166174
SQLObject 0.9.10
167175
================
168176

‎sqlobject/sqlite/sqliteconnection.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,9 +295,12 @@ def _columnsFromSchemaTableInfo(self, tableName, soClass):
295295
colData = self.queryAll("PRAGMA table_info(%s)" % tableName)
296296
results = []
297297
for index, field, t, nullAllowed, default, key in colData:
298-
if field == 'id':
298+
if field == soClass.sqlmeta.idName:
299299
continue
300300
colClass, kw = self.guessClass(t)
301+
if default == 'NULL':
302+
nullAllowed = True
303+
default = None
301304
kw['name'] = soClass.sqlmeta.style.dbColumnToPythonAttr(field)
302305
kw['dbName'] = field
303306
kw['notNone'] = not nullAllowed

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL