[web2py] Re: SQLite tables not recognised in web2py; even when web2py created them?

2013-02-08 Thread Alec Taylor
Fully self contained example: >web2py.py -p 80 -S myapp2 web2py Web Framework Created by Massimo Di Pierro, Copyright 2007-2013 Version 2.4.1-alpha.2+timestamp.2013.02.07.05.36.19 Database drivers available: SQLite(sqlite3), MySQL(pymysql), PostgreSQL(pg8000), Oracle(cx_Oracle), MongoDB(pymongo),

[web2py] Re: SQLite tables not recognised in web2py; even when web2py created them?

2013-02-08 Thread Niphlod
dal has no introspection (i.e. it doesn't ask any "schema" information, nor it tries to "calculate" it). until you define your tables (or do DAL(, auto_import=True)) DAL will never know that a table exists. On Friday, February 8, 2013 5:14:22 PM UTC+1, Alec Taylor wrote: > > Fully self con

Re: [web2py] Re: SQLite tables not recognised in web2py; even when web2py created them?

2013-02-08 Thread Alec Taylor
On Sat, Feb 9, 2013 at 6:28 AM, Niphlod wrote: > dal has no introspection (i.e. it doesn't ask any "schema" information, nor > it tries to "calculate" it). > > until you define your tables (or do DAL(, auto_import=True)) DAL will > never know that a table exists. Unfortunately that didn't wor

Re: [web2py] Re: SQLite tables not recognised in web2py; even when web2py created them?

2013-02-08 Thread Vasile Ermicioi
let say you have table1 and table2 in database, you shoud define your tables db.define_table('table1', ..) and only after that you will have access to db.table1 you can;t access db.table2 if it is not defined even if it exists in the database -- --- You received this message because you are

Re: [web2py] Re: SQLite tables not recognised in web2py; even when web2py created them?

2013-02-08 Thread Alec Taylor
Hold up; you mean to tell me I need to redefine the schema each time a new db (DAL object) needs to access it? That sounds silly. Isn't there a way around this? On Saturday, February 9, 2013 4:40:28 PM UTC+11, Vasile Ermicioi wrote: > > let say you have table1 and table2 in database, > > you s

Re: [web2py] Re: SQLite tables not recognised in web2py; even when web2py created them?

2013-02-08 Thread Bruno Rocha
Usually you create a "script" file in /models/db.py then you define your tables there, so when starting in shell mode you pass -M python web2py.py -S yourapp -M -M run the models/* files and defines your table as "object" for you to access. Every framework works in this way. Optionally, you can

Re: [web2py] Re: SQLite tables not recognised in web2py; even when web2py created them?

2013-02-08 Thread Alec Taylor
But I am creating a contrib for: https://github.com/web2py/web2py/tree/master/gluon/contrib/login_methods (OAuth2; my work-in-progress is on Github) But because of the design of the standard I require 3 additional tables + a user table. So how do you propose I manage this scenario? On Sat, Feb

Re: [web2py] Re: SQLite tables not recognised in web2py; even when web2py created them?

2013-02-09 Thread Bruno Rocha
If your contrib needs to have its own models and controllers, then you should create it as a plugin. Or you can create a module and define an API for it, take a dummy example. /modules/myawesomemodule.py class MyAwesomeClass(object): """ it creates the Awesome object which is a login_met

Re: [web2py] Re: SQLite tables not recognised in web2py; even when web2py created them?

2013-02-09 Thread Alec Taylor
Mmm, suppose I could do things like that… But it is rather annoying that web2py has no built-in reverse-engineering (intropspection) that can impose a web2py overlay atop an existing database… On Sat, Feb 9, 2013 at 7:04 PM, Bruno Rocha wrote: > If your contrib needs to have its own models and c

Re: [web2py] Re: SQLite tables not recognised in web2py; even when web2py created them?

2013-02-09 Thread Vasile Ermicioi
> > But it is rather annoying that web2py has no built-in > reverse-engineering (intropspection) that can impose a web2py overlay > atop an existing database there are some scripts to generate models from database, web2py/scripts/extract_mysql_models.py web2py/scripts/extract_pgsql_models.py web

Re: [web2py] Re: SQLite tables not recognised in web2py; even when web2py created them?

2013-02-09 Thread Niphlod
wait a second . you may be missing an important bit. DAL has no introspection whatsoever for retrieving existing tables if you have not defined them. That doesn't mean that you have to define tables at every connection (it's easy, but let's assume you don't want to). When you define tables o

Re: [web2py] Re: SQLite tables not recognised in web2py; even when web2py created them?

2013-02-09 Thread Alec Taylor
On Sat, Feb 9, 2013 at 11:53 PM, Niphlod wrote: > wait a second . you may be missing an important bit. > DAL has no introspection whatsoever for retrieving existing tables if you > have not defined them. > That doesn't mean that you have to define tables at every connection (it's > easy, but l

Re: [web2py] Re: SQLite tables not recognised in web2py; even when web2py created them?

2013-02-09 Thread Alec Taylor
Okay, GitHub maintenance has ended. That pull-request isn't for a server; it's for a consumer. I'm building—and have just about finished—an OAuth2 server (provider) for web2py. To put it simply: We currently consume Facebook to grab facebook user details and whatnot With my package we will be