All this occurs within the same function. I can create, and read
tables within the same function.  I'm having trouble deleting or
updating within this same function when I return to the function. When
I create the tables I can update them just as I've defined them by
using a generic name + the user's id. The tables are created by web2py
with a 31 digit hex number appended to the generic name + user id.
I've tried updating and deleting these tables with and without the
31hex number, which is the same for all files. It seems the hex number
is the migration code, but I could not see how to obtain this using
python.

All of the data remains in the tables created within the SUMMARY
function. Do I have to save and restore session information across
view changes to be able to continue to update and use these tables
created within SUMMARY? The end users will frequently create and drop
private tables, so I must be able to create and drop tables on demand.
- I don't see how I can do this in db.py.   Any advice would be
appreciated on using the tables in the function or doing it all in
db.py.   thanks in advance, james c.

##### this is in db.py #################################
current_view_template = db.Table(db, 'current_view_template',
                                    Field('customer'),
                                    Field('now_viewing'))


### this is all in the same function SUMMARY in default.py ###########
        current_view_db = 'current_view_' + str(auth.user_id)
        db.define_table(current_view_db,  current_view_template)
        db[current_view_db].insert(customer = core_customer_name,
now_viewing = 'yes')
:
.
a refreshed view is returned from SUMMARY

        this_current_view = M + '_current_view_' + str(auth.user_id)
        print this_current_view
        db[this_current_view].drop()
then something like
this occurs KeyError: 'a2a334d2396a7109e5f7ab33568e5b7_current_view_8'

Reply via email to