Re: [web2py] delete a SQLTABLE column
Wrong thread I think! ;-) Richard On Tue, Aug 2, 2011 at 7:18 PM, pbreit pbreitenb...@gmail.com wrote: Navicat Lite or SQLite Manager for Firefox
Re: [web2py] delete a SQLTABLE column
That's how I delete columns.
Re: [web2py] delete a SQLTABLE column
I think he wants to delete columns from a SQLTABLE, not a db table. On Wednesday, August 3, 2011 4:01:09 PM UTC-4, pbreit wrote: That's how I delete columns.
Re: [web2py] delete a SQLTABLE column
Yes... I use pgAdmin for the other things, I didn't fix my choice on a commercial database manager... ;-) Richard On Wed, Aug 3, 2011 at 4:04 PM, Anthony abasta...@gmail.com wrote: I think he wants to delete columns from a SQLTABLE, not a db table. On Wednesday, August 3, 2011 4:01:09 PM UTC-4, pbreit wrote: That's how I delete columns.
Re: [web2py] delete a SQLTABLE column
Don't know if my delete column function could be part of web2py core functions but here it is : def __del_sqltable_column(sqltable, column_name): For deleting a given column in an instance of web2py SQLTABLE class. Pass the SQLTABLE object and the column name to delete. Ex.: table1 = SQLTABLE(rows) contains id column and we want to delete it. So we call __del_sqltable_column(tabel1, 'table.id') or __del_sqltable_column(request.args(0), db[request.args(0)].id) When the column name is changed with represent the representation should be passed as column name. import re regex_colum_name = re.compile(str(TH(column_name))) for i in range(0, len(sqltable[0][0])): if regex_colum_name.match(str(sqltable[0][0][i])): for r in range(0, len(sqltable[1])): del(sqltable[1][r][i]) del(sqltable[0][0][i]) return sqltable return sqltable It could be my first contribution to web2py ;-) Richard On Wed, Aug 3, 2011 at 4:08 PM, Richard Vézina ml.richard.vez...@gmail.comwrote: Yes... I use pgAdmin for the other things, I didn't fix my choice on a commercial database manager... ;-) Richard On Wed, Aug 3, 2011 at 4:04 PM, Anthony abasta...@gmail.com wrote: I think he wants to delete columns from a SQLTABLE, not a db table. On Wednesday, August 3, 2011 4:01:09 PM UTC-4, pbreit wrote: That's how I delete columns.
Re: [web2py] delete a SQLTABLE column
Here I go ;-) rows = db().select(db.table1.ALL) table = SQLTABLE(rows) for i in range(0, len(table[1])): del(table[1][i][0]) del(table[0][0][0]) # Delete the header entry of the deleted column Richard On Tue, Aug 2, 2011 at 2:17 PM, Richard ml.richard.vez...@gmail.com wrote: Hello, If you have a easy way to delete a entire SQLTABLE column before I find a way, I will take it. Thanks. Richard
Re: [web2py] delete a SQLTABLE column
Navicat Lite or SQLite Manager for Firefox