[web2py] Re: Define table but not add it to the database

2017-05-19 Thread Sundar
Yes, 'attaching the table' does not allow references. On second thoughts, it is somewhat inconvenient to use that feature too. Let me see if another method will work. In web2py directory, under site-packages, you can define a module (or a simple .py file) wherein you can define the required dic

[web2py] Re: Define table but not add it to the database

2017-05-18 Thread lyn2py
Thanks Sundar, but attaching DBs don't allow me to reference the "attached" tables right? On Thursday, May 18, 2017 at 5:27:03 PM UTC+8, Sundar wrote: > > See https://www.sqlite.org/lang_attach.html solves your problem. > > Cheers. > === > > On Tues

[web2py] Re: Define table but not add it to the database

2017-05-18 Thread Sundar
See https://www.sqlite.org/lang_attach.html solves your problem. Cheers. === On Tuesday, May 16, 2017 at 5:46:25 PM UTC+5:30, lyn2py wrote: > > Is there is a way to define a table without adding it to the sqlite > database? I wish to define a table

[web2py] Re: Define table but not add it to the database

2017-05-17 Thread Dave S
On Wednesday, May 17, 2017 at 1:58:04 AM UTC-7, lyn2py wrote: > > Please bear with me while I explain my use case: > > I have a list of "standard" websites, like all the major search engines. > Traditionally, I can make do with a python list, like so: > > list_of_sites =['google.com','yahoo.com'

[web2py] Re: Define table but not add it to the database

2017-05-17 Thread Anthony
Note, you could consider storing this table in its own separate SQLite database, but then you won't be able to have tables in other databases reference it and do joins with it (you would have to manage relationships and joins in your Python app code). Anthony On Wednesday, May 17, 2017 at 8:12

[web2py] Re: Define table but not add it to the database

2017-05-17 Thread Anthony
> > In summary, I am using sqlite db. There is a table that I don't wish to > store in the sqlite db, but yet have that particular table data be served / > accessed like a normal table (as if from the db). Is that possible, and how > can I achieve this? > I don't think so. If you need to have

[web2py] Re: Define table but not add it to the database

2017-05-17 Thread lyn2py
Please bear with me while I explain my use case: I have a list of "standard" websites, like all the major search engines. Traditionally, I can make do with a python list, like so: list_of_sites =['google.com','yahoo.com',...] However, the code base has evolved and it's much better to have othe

[web2py] Re: Define table but not add it to the database

2017-05-17 Thread Sundar
You still need somewhere to 'store' it. Rght? May be you can create another SQLITE DB (say db1) and use it for your purpose. (Of course, 'join'ing with db1 table data will have to be done through your program). On Tuesday, May 16, 2017 at 5:46:

[web2py] Re: Define table but not add it to the database

2017-05-16 Thread Anthony
On Tuesday, May 16, 2017 at 12:34:01 PM UTC-4, lyn2py wrote: > > Thanks Anthony, I'm sorry my question was ambiguous. > > I meant to define a table and to add data to a table that doesn't exist in > the sqlite table, but yet web2py can get the data (I can "hardcode" the > data into the controller

[web2py] Re: Define table but not add it to the database

2017-05-16 Thread Dave S
On Tuesday, May 16, 2017 at 9:34:01 AM UTC-7, lyn2py wrote: > > Thanks Anthony, I'm sorry my question was ambiguous. > > I meant to define a table and to add data to a table that doesn't exist in > the sqlite table, but yet web2py can get the data (I can "hardcode" the > data into the controlle

[web2py] Re: Define table but not add it to the database

2017-05-16 Thread lyn2py
Thanks Anthony, I'm sorry my question was ambiguous. I meant to define a table and to add data to a table that doesn't exist in the sqlite table, but yet web2py can get the data (I can "hardcode" the data into the controller or model). How do I achieve that? Or rather can I? Thank you again!

[web2py] Re: Define table but not add it to the database

2017-05-16 Thread Anthony
On Tuesday, May 16, 2017 at 8:16:25 AM UTC-4, lyn2py wrote: > > Is there is a way to define a table without adding it to the sqlite > database? I wish to define a table and have data in that table, but not add > it to the sqlite db. > You can do db.define_table(..., migrate=False). This assumes