Dear all, 
I have a sqlite file test.sqlite, stored in /static/db/, and that contains 
a 'Name' table with fields title, number and def.

I have checked that file with sql_browser and the content is Ok.
I just mean to read only the table (never add/remove/edit)

I import the sqlite file in db.py with:
db_name = DAL('sqlite://test.sqlite',
                
folder='/home/..../www/web2py-R-2.9.11/applications/.../static/db/',
                auto_import=True
                ) 

Then, as a test in index.html I do the following:

{{from gluon import current}}
{{db_name = current.globalenv['db_name']}}
{{query = db_name(db_name.Name.number=='1122')}}
{{count = query.count()}}
{{pass}}

There should be one row in total ... but I get the following error:
<type 'exceptions.AttributeError'>('DAL' object has no attribute 'Name')

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to