web/lib/django/db/backends/sqlite3/introspection.py
changeset 29 cc9b7e14412b
parent 0 0d40e90630ef
--- a/web/lib/django/db/backends/sqlite3/introspection.py	Wed May 19 17:43:59 2010 +0200
+++ b/web/lib/django/db/backends/sqlite3/introspection.py	Tue May 25 02:43:45 2010 +0200
@@ -16,6 +16,7 @@
         'smallinteger': 'SmallIntegerField',
         'int': 'IntegerField',
         'integer': 'IntegerField',
+        'bigint': 'BigIntegerField',
         'integer unsigned': 'PositiveIntegerField',
         'decimal': 'DecimalField',
         'real': 'FloatField',
@@ -65,7 +66,7 @@
         relations = {}
 
         # Schema for this table
-        cursor.execute("SELECT sql FROM sqlite_master WHERE tbl_name = %s", [table_name])
+        cursor.execute("SELECT sql FROM sqlite_master WHERE tbl_name = %s AND type = %s", [table_name, "table"])
         results = cursor.fetchone()[0].strip()
         results = results[results.index('(')+1:results.rindex(')')]