equal
deleted
inserted
replaced
14 'smallint': 'SmallIntegerField', |
14 'smallint': 'SmallIntegerField', |
15 'smallint unsigned': 'PositiveSmallIntegerField', |
15 'smallint unsigned': 'PositiveSmallIntegerField', |
16 'smallinteger': 'SmallIntegerField', |
16 'smallinteger': 'SmallIntegerField', |
17 'int': 'IntegerField', |
17 'int': 'IntegerField', |
18 'integer': 'IntegerField', |
18 'integer': 'IntegerField', |
|
19 'bigint': 'BigIntegerField', |
19 'integer unsigned': 'PositiveIntegerField', |
20 'integer unsigned': 'PositiveIntegerField', |
20 'decimal': 'DecimalField', |
21 'decimal': 'DecimalField', |
21 'real': 'FloatField', |
22 'real': 'FloatField', |
22 'text': 'TextField', |
23 'text': 'TextField', |
23 'char': 'CharField', |
24 'char': 'CharField', |
63 |
64 |
64 # Dictionary of relations to return |
65 # Dictionary of relations to return |
65 relations = {} |
66 relations = {} |
66 |
67 |
67 # Schema for this table |
68 # Schema for this table |
68 cursor.execute("SELECT sql FROM sqlite_master WHERE tbl_name = %s", [table_name]) |
69 cursor.execute("SELECT sql FROM sqlite_master WHERE tbl_name = %s AND type = %s", [table_name, "table"]) |
69 results = cursor.fetchone()[0].strip() |
70 results = cursor.fetchone()[0].strip() |
70 results = results[results.index('(')+1:results.rindex(')')] |
71 results = results[results.index('(')+1:results.rindex(')')] |
71 |
72 |
72 # Walk through and look for references to other tables. SQLite doesn't |
73 # Walk through and look for references to other tables. SQLite doesn't |
73 # really have enforced references, but since it echoes out the SQL used |
74 # really have enforced references, but since it echoes out the SQL used |