[web2py] Error on web2py book

2012-04-18 Thread Cody Goodman
Going through the web2py book, and noticed an error on this page: http://web2py.com/books/default/chapter/29/3 def find_by(keyword): "finds pages that contain keyword for XML-RPC" return db(db.page.title.contains(keyword).select().as_list() should be: def find_by(keyword): "fi

[web2py] What would be the best way to generate a summary of the 'count(*) 'of all my database table columns?

2012-04-19 Thread Cody Goodman
ow. Thanks in advance for any help. Sincerely, Cody Goodman

[web2py] Re: What would be the best way to generate a summary of the 'count(*) 'of all my database table columns?

2012-04-20 Thread Cody Goodman
ta. > For table in db.tables: > column_count = 0 > for field in table.fields > column_count += 1 > print table.name > print column_count > > On Thursday, April 19, 2012 9:57:57 PM UTC-4, Cody Goodman wrote: >> >> I have multiple databases: >&g

Re: [web2py] Re: What would be the best way to generate a summary of the 'count(*) 'of all my database table columns?

2012-04-21 Thread Cody Goodman
Well I tried that, and it gave me: In [2] : db(db.legacy_db.table).select() Traceback (most recent call last): File "/opt/web-apps/web2py/gluon/contrib/shell.py", line 233, in run exec compiled in statement_module.__dict__ File "", line 1, in File "/opt/web-apps/web2py/gluon/dal.py", li

[web2py] Re: Image tutorial error multiple databases

2012-04-21 Thread Cody Goodman
also tried the alternate syntax for getting info from the db: In [10] : print db(db.images_db.image).select() Traceback (most recent call last): File "/home/cody/Downloads/web2py/gluon/contrib/shell.py", line 233, in run exec compiled in statement_module.__dict__ File "", line 1, in Fi

[web2py] Re: Image tutorial error multiple databases

2012-04-21 Thread Cody Goodman
it seems that the answer is to not use db(), but use: name_of_dal_object(name_of_dal_object.table).select()