*static/scripts/python/mover.py*
URI = 'mysql://root:mysqlpassword@localhost/site'
other_db = DAL(URI, auto_import = True)
print ('Exporting data')
db.export_to_csv_file(open('tmp.csv', 'wb') )
print ('Importing data')
other_db.import_from_csv_file(open('tmp.csv', 'rb') )
other_db.commit()
print ('
tried, modify the code but have another error : ModuleNotFoundError, any
idea?
*static/scripts/python/mover.py*
import site_scheduler
import site_scrape
def main():
URI = 'mysql://root:mysql@localhost/site'
other_db = DAL(URI, auto_import = True)
print ('exporting data')
db.export_
>
> tried the script too, but having no luck
> *static/scripts/python/mover.py*
> def main():
> URI = 'mysql://root:mysqlpassword@localhost/site'
> other_db = DAL(URI)
> print ("creating tables")
> for table in db:
> other_db.define_table(table._tablename, *[field for field
tried the script too, but having no luck
*static/scripts/python/mover.py*
def main():
URI = 'mysql://root:mysqlpassword@localhost/site'
other_db = DAL(URI)
print ("creating tables")
for table in db:
other_db.define_table(table._tablename, *[field for field in table]
)
p
Thanks, Anthony.
I could create the authentication tables with the modifications you
suggested.
I wrote a script to transfer the rest of the data to the other tables.
Thanks again,
2018-07-22 0:59 GMT-03:00 Anthony :
> I assume you're getting this from the "web2py Application Development
> Coo
I assume you're getting this from the "web2py Application Development
Cookbook". Note, there is no -N option -- that's just an error in the book.
As for the code, in mover.py, try changing:
*[field for field in table]
to:
*[field.clone() for field in table]
The DAL will no longer let you simp
6 matches
Mail list logo