I am following through on a suggestion Massimo offered to be able to
select particular db's. Essentially the code works quite well in a
test app --
# coding: utf8
# try something like
import os
def create():
files=os.listdir(os.path.join(request.folder,'databases'))
# choose a file, for example
file=files[1]
db=SQLDB('sqlite://%s'+file)
db.define_table('table1', db.Field('field1','string'))
db.define_table('table2', db.Field('field2','string'))
db.define_table('table3', db.Field('field3','string'))
return
However looking at the process from how the application will operate
the potential is that there could be 100's of separate db's and Nx
that many tables. So I have been exploring the idea of possibly using
subdirectories of 'databases' parent to keep the layout logical.
Something like --
../databases
/smythe2675476
/harris04204
/arnold47345
db.db
152345123512435145_table1.table
356783456256745736_table2.table
789574356737224356_table3.table
...
...
Employing that idea with some test code I can get the db.db to be
created in the appropriate subdirectory. The associated tables however
end up back in the parent dir -- /databases. Is there a workaround?
Thanks.
JohnMc
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---