>>> db.export_to_csv_file(open('/home/thadeusb/Desktop/data.csv', 'wb'))
#then later
>>> db.import_from_csv_file(open('/home/thadeusb/Desktop/data.csv', 'r'))
Traceback (most recent call last):
File "/home/thadeusb/Applications/web2py-devel/gluon/restricted.py", line 184, in restricted
exec ccode in environment
File "/home/thadeusb/Applications/web2py-devel/applications/bootygrab/controllers/default.py", line 617, in <module>
File "/home/thadeusb/Applications/web2py-devel/gluon/globals.py", line 102, in <lambda>
self._caller = lambda f: f()
File "/home/thadeusb/Applications/web2py-devel/applications/bootygrab/controllers/default.py", line 566, in dbio
db.import_from_csv_file(open('/home/thadeusb/Desktop/bootygrab.csv', 'r'))
File "/home/thadeusb/Applications/web2py-devel/gluon/sql.py", line 1193, in import_from_csv_file
self[tablename].import_from_csv_file(ifile, id_map, null, unique)
File "/home/thadeusb/Applications/web2py-devel/gluon/sql.py", line 1705, in import_from_csv_file
for line in reader:
Error: field larger than field limit (131072)
Wow I am just having lots of problems tonight, Ok so creating my table on a fresh mysql database causes this error.
This key error happens on the following fields
Field('booty_url', length=300), Field('tank_data', 'text'))
Traceback (most recent call last):
File "/home/thadeusb/Applications/web2py-devel/gluon/restricted.py", line 184, in restricted
exec ccode in environment
File "/home/thadeusb/Applications/web2py-devel/applications/bootygrab/models/db.py", line 76, in <module>
Field('tank_data', 'text'))
File "/home/thadeusb/Applications/web2py-devel/gluon/sql.py", line 1130, in define_table
query = t._create(migrate=migrate)
File "/home/thadeusb/Applications/web2py-devel/gluon/sql.py", line 1470, in _create
self._db._execute(query)
File "/home/thadeusb/Applications/web2py-devel/gluon/sql.py", line 805, in <lambda>
self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
File "/usr/lib/python2.6/site-packages/MySQLdb/cursors.py", line 173, in execute
self.errorhandler(self, exc, value)
File "/usr/lib/python2.6/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
raise errorclass, errorvalue
OperationalError: (1071, 'Specified key was too long; max key length is 767 bytes')
Traceback (most recent call last):
File "/home/thadeusb/Applications/web2py-devel/gluon/restricted.py", line 184, in restricted
exec ccode in environment
File "/home/thadeusb/Applications/web2py-devel/applications/welcome/models/db.py", line 54, in <module>
Field('count', 'integer'),
File "/home/thadeusb/Applications/web2py-devel/gluon/sql.py", line 1130, in define_table
query = t._create(migrate=migrate
)
File "/home/thadeusb/Applications/web2py-devel/gluon/sql.py", line 1396, in _create
elif field.type[:10] == 'reference ':
TypeError: 'NoneType' object is unsubscriptable
OperationalError: (1071, 'Specified key was too long; max key length is 767 bytes')