I have to ask...

Why on earth do you have dynamic columns? Can you tell us more as to why
you *need* this, maybe there is a better way.

You can always dynamically build your db.define_table() statements, the
DAL will migrate them as needed.

SO first, build your dynamic fields in a python list

my_fields = []

for what_i_need in what_i_base_it_off_of:
   if what_i_need == what_i_want:
     my_fields.append(Field('ms1'))
   else:
     my_fields.append(Field('ms2'))

db.define_table('SuperDynamicTable', *my_fields)

-- 
ThadeusB


On Sat, 2010-04-10 at 21:53 -0700, Marc Dojka wrote:
> I'm thinking of switching a site from php to python on web2py, however
> I've got a question on its mysql support.  I'm trying to figure out
> how web2py handles tables where the column layout isn't fixed.
> Meaning that it's possible for columns to be created, used, and
> deleted by the app while it's running.  Currently I assign api names
> to these columns (ms1, ms2, ...).  There is a seperate table that
> tells the app some information about these columns (and that they
> exist).  Everything works great in php land.  Let me know.  Thanks.
> 
> 



-- 
To unsubscribe, reply using "remove me" as the subject.

Reply via email to