[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), IMAP(imaplib)
Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)]
Type "copyright", "credits" or "license" for more information.

In [1]: db = DAL('sqlite://myapp2.sqlite', pool_size=1, check_reserved=['all'])

In [2]: db.tables
Out[2]: []

In [3]: db.define_table('examples_are_awesome', Field('foo'))
Out[3]: 

In [4]: db.commit() # tried with + without this line

In [5]: db.tables
Out[5]: ['examples_are_awesome']

In [6]: exit

>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), IMAP(imaplib)
Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)]
Type "copyright", "credits" or "license" for more information.

In [1]: db = DAL('sqlite://myapp2.sqlite', pool_size=1, check_reserved=['all'])

In [2]: db.tables()
Out[2]: []

On Sat, Feb 9, 2013 at 3:07 AM, Alec Taylor  wrote:
> Experiencing some very strange errors on the latest web2py
> (2.4.1-alpha.2+timestamp.2013.02.07.05.36.19).
>
> In my 'myapp2' application I have created a database, defined as follows:
>
> db = DAL('sqlite://mydb2.sqlite', pool_size=1, check_reserved=['all'])
>
> Now I defined some tables and inserted some data into it. (all from
> the \modules folder)
>
> To confirm the tables and data exists I opened up the 5KB SQLite file
> in two different external database programs, including the SQLite
> Manager firefox extension.
>
> It was all there.
>
> But one of my functions in that same \modules folder couldn't find an
> entry in the db (the db DAL object was sent from \controllers though).
>
> So from my code (and subsequent from $web2py.py -S myapp2) I ran
> db.tables and got [].
>
> The exact same connection string is used throughout my code; so why
> isn't this working?
>
> Thanks for all suggestions,
>
> Alec Taylor
>
> PS: Searching my entire web2py directory brought up only one sqlite
> file named 'mydb2'

-- 

--- 
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/groups/opt_out.




[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 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), IMAP(imaplib) 
> Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)] 
> Type "copyright", "credits" or "license" for more information. 
>
> In [1]: db = DAL('sqlite://myapp2.sqlite', pool_size=1, 
> check_reserved=['all']) 
>
> In [2]: db.tables 
> Out[2]: [] 
>
> In [3]: db.define_table('examples_are_awesome', Field('foo')) 
> Out[3]:  
>
> In [4]: db.commit() # tried with + without this line 
>
> In [5]: db.tables 
> Out[5]: ['examples_are_awesome'] 
>
> In [6]: exit 
>
> >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), IMAP(imaplib) 
> Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)] 
> Type "copyright", "credits" or "license" for more information. 
>
> In [1]: db = DAL('sqlite://myapp2.sqlite', pool_size=1, 
> check_reserved=['all']) 
>
> In [2]: db.tables() 
> Out[2]: [] 
>
> On Sat, Feb 9, 2013 at 3:07 AM, Alec Taylor 
> > 
> wrote: 
> > Experiencing some very strange errors on the latest web2py 
> > (2.4.1-alpha.2+timestamp.2013.02.07.05.36.19). 
> > 
> > In my 'myapp2' application I have created a database, defined as 
> follows: 
> > 
> > db = DAL('sqlite://mydb2.sqlite', pool_size=1, check_reserved=['all']) 
> > 
> > Now I defined some tables and inserted some data into it. (all from 
> > the \modules folder) 
> > 
> > To confirm the tables and data exists I opened up the 5KB SQLite file 
> > in two different external database programs, including the SQLite 
> > Manager firefox extension. 
> > 
> > It was all there. 
> > 
> > But one of my functions in that same \modules folder couldn't find an 
> > entry in the db (the db DAL object was sent from \controllers though). 
> > 
> > So from my code (and subsequent from $web2py.py -S myapp2) I ran 
> > db.tables and got []. 
> > 
> > The exact same connection string is used throughout my code; so why 
> > isn't this working? 
> > 
> > Thanks for all suggestions, 
> > 
> > Alec Taylor 
> > 
> > PS: Searching my entire web2py directory brought up only one sqlite 
> > file named 'mydb2' 
>

-- 

--- 
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/groups/opt_out.




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 work…

In [1]: db = DAL('sqlite://myapp2.sqlite', pool_size=1,
check_reserved=['all'], auto_import=True)
---
TypeError Traceback (most recent call last)
 in ()
> 1 db = DAL('sqlite://myapp2.sqlite', pool_size=1,
check_reserved=['all'], auto_import=True)

web2py\gluon\dal.pyc in __init__(self, uri, pool_size, folder,
db_codec, check_reserved, migrate, fake_migrate, migrate_
enabled, fake_migrate_all, decode_credentials, driver_args,
adapter_args, attempts, auto_import, bigint_id, debug, lazy_tables,
db_uid, do_connect)
   7228 if auto_import or dbdict:
   7229 self.import_table_definitions(adapter.folder,
-> 7230   items=dbdict["items"])
   7231
   7232 @property

TypeError: 'NoneType' object has no attribute '__getitem__'

> On Friday, February 8, 2013 5:14:22 PM UTC+1, Alec Taylor wrote:
>>
>> 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), IMAP(imaplib)
>> Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)]
>> Type "copyright", "credits" or "license" for more information.
>>
>> In [1]: db = DAL('sqlite://myapp2.sqlite', pool_size=1,
>> check_reserved=['all'])
>>
>> In [2]: db.tables
>> Out[2]: []
>>
>> In [3]: db.define_table('examples_are_awesome', Field('foo'))
>> Out[3]: 
>>
>> In [4]: db.commit() # tried with + without this line
>>
>> In [5]: db.tables
>> Out[5]: ['examples_are_awesome']
>>
>> In [6]: exit
>>
>> >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), IMAP(imaplib)
>> Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)]
>> Type "copyright", "credits" or "license" for more information.
>>
>> In [1]: db = DAL('sqlite://myapp2.sqlite', pool_size=1,
>> check_reserved=['all'])
>>
>> In [2]: db.tables()
>> Out[2]: []
>>
>> On Sat, Feb 9, 2013 at 3:07 AM, Alec Taylor  wrote:
>> > Experiencing some very strange errors on the latest web2py
>> > (2.4.1-alpha.2+timestamp.2013.02.07.05.36.19).
>> >
>> > In my 'myapp2' application I have created a database, defined as
>> > follows:
>> >
>> > db = DAL('sqlite://mydb2.sqlite', pool_size=1, check_reserved=['all'])
>> >
>> > Now I defined some tables and inserted some data into it. (all from
>> > the \modules folder)
>> >
>> > To confirm the tables and data exists I opened up the 5KB SQLite file
>> > in two different external database programs, including the SQLite
>> > Manager firefox extension.
>> >
>> > It was all there.
>> >
>> > But one of my functions in that same \modules folder couldn't find an
>> > entry in the db (the db DAL object was sent from \controllers though).
>> >
>> > So from my code (and subsequent from $web2py.py -S myapp2) I ran
>> > db.tables and got [].
>> >
>> > The exact same connection string is used throughout my code; so why
>> > isn't this working?
>> >
>> > Thanks for all suggestions,
>> >
>> > Alec Taylor
>> >
>> > PS: Searching my entire web2py directory brought up only one sqlite
>> > file named 'mydb2'
>
> --
>
> ---
> 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/groups/opt_out.
>
>

-- 

--- 
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/groups/opt_out.




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 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/groups/opt_out.




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 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 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/groups/opt_out.




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 use db.executesql("PUT YOUR SQL HERE") and do it by
your own...

On Sat, Feb 9, 2013 at 4:13 AM, Alec Taylor  wrote:

> 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 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 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/groups/opt_out.
>
>
>

-- 

--- 
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/groups/opt_out.




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 9, 2013 at 6:26 PM, Bruno Rocha  wrote:
> 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 use db.executesql("PUT YOUR SQL HERE") and do it by your
> own...
>
>
> On Sat, Feb 9, 2013 at 4:13 AM, Alec Taylor  wrote:
>>
>> 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 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 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/groups/opt_out.
>>
>>
>
>
> --
>
> ---
> 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/groups/opt_out.
>
>

-- 

--- 
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/groups/opt_out.




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_method
to use include in your models
db = DAL()
from myawesomemodule import MyAwesomeClass
something = MyAwesomeClass(db)
something.define_tables()
auth.settings.login_methods = something
"""

def __init__(db, *args, **kwargs):
self.db = db

def define_tables(self, migrate=True):
self.table1 = self.db.define_table("table1",
Field("a_field"),
migrate=migrate
)

self.table2 = self.db.define_table("table2",
Field("a_field"),
migrate=migrate
)

def do_something(self):
self.data = self.db(.).select()
# do domething
return data

Then in following your documentation developers should use you module api
as:

models/db.py

db = DAL(.)

from myawesomemodule import MyAwesomeClass

something = MyAwesomeClass(db)
something.define_tables()

auth.settings.login_methods = something


On Sat, Feb 9, 2013 at 5:34 AM, Alec Taylor  wrote:

> 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 9, 2013 at 6:26 PM, Bruno Rocha  wrote:
> > 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 use db.executesql("PUT YOUR SQL HERE") and do it by
> your
> > own...
> >
> >
> > On Sat, Feb 9, 2013 at 4:13 AM, Alec Taylor 
> wrote:
> >>
> >> 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 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 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/groups/opt_out.
> >>
> >>
> >
> >
> > --
> >
> > ---
> > 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/groups/opt_out.
> >
> >
>
> --
>
> ---
> 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/groups/opt_out.
>
>
>

-- 

--- 
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/groups/opt_out.




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 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_method
> to use include in your models
> db = DAL()
> from myawesomemodule import MyAwesomeClass
> something = MyAwesomeClass(db)
> something.define_tables()
> auth.settings.login_methods = something
> """
>
> def __init__(db, *args, **kwargs):
> self.db = db
>
> def define_tables(self, migrate=True):
> self.table1 = self.db.define_table("table1",
> Field("a_field"),
> migrate=migrate
> )
>
> self.table2 = self.db.define_table("table2",
> Field("a_field"),
> migrate=migrate
> )
>
> def do_something(self):
> self.data = self.db(.).select()
> # do domething
> return data
>
> Then in following your documentation developers should use you module api
> as:
>
> models/db.py
>
> db = DAL(.)
>
> from myawesomemodule import MyAwesomeClass
>
> something = MyAwesomeClass(db)
> something.define_tables()
>
> auth.settings.login_methods = something
>
>
>
> On Sat, Feb 9, 2013 at 5:34 AM, Alec Taylor  wrote:
>>
>> 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 9, 2013 at 6:26 PM, Bruno Rocha  wrote:
>> > 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 use db.executesql("PUT YOUR SQL HERE") and do it by
>> > your
>> > own...
>> >
>> >
>> > On Sat, Feb 9, 2013 at 4:13 AM, Alec Taylor 
>> > wrote:
>> >>
>> >> 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 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 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/groups/opt_out.
>> >>
>> >>
>> >
>> >
>> > --
>> >
>> > ---
>> > 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/groups/opt_out.
>> >
>> >
>>
>> --
>>
>> ---
>> 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/groups/opt_out.
>>
>>
>
> --
>
> ---
> 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/groups/opt_out.
>
>

-- 

--- 
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/groups/opt_out.




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
web2py/scripts/extract_sqlite_models.py

perhaps you can build your own reverse engineering tool :)

-- 

--- 
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/groups/opt_out.




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 on an empty database, some .table files are created 
in the databases/ folder .
They are pickles of the table structure, the same one DAL uses to compare 
with the existing model and - optionally - do a migration.
Once you have those .table files, you can skip the define_table() 
statements giving auto_import=True to the DAL connection (obviously the 
database uri has to be the same one with the tables in it). The only thing 
you may need is to pass along the folder where the .table files are with 
the folder parameter .

PS: an oauth2 implementation has been achieved by michele, it's a few days 
away to be included in the web2py source . 
https://github.com/web2py/web2py/pull/57

-- 

--- 
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/groups/opt_out.




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 let's assume you don't want to).
> When you define tables on an empty database, some .table files are created
> in the databases/ folder .
> They are pickles of the table structure, the same one DAL uses to compare
> with the existing model and - optionally - do a migration.
> Once you have those .table files, you can skip the define_table() statements
> giving auto_import=True to the DAL connection (obviously the database uri
> has to be the same one with the tables in it). The only thing you may need
> is to pass along the folder where the .table files are with the folder
> parameter .
>
> PS: an oauth2 implementation has been achieved by michele, it's a few days
> away to be included in the web2py source .
> https://github.com/web2py/web2py/pull/57

Wait, what, seriously?!

:(

I can't see that pull request ATM (github is under maintenance), but I
did post an announcement here on the web2py list over 8 days ago…

Might've been nicer to tell me then.

Anyway, I have around 30 custom exceptions built on the
gluon.http.HTTP class, so will review the patch once github is back
online and see what I can integrate… I guess

-- 

--- 
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/groups/opt_out.




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 able to expose our data for other people to
consume; in the same way other people consume Facebook.

Anyway, it's very close to completion. Have a handful of [found] bugs left.

Also fixed that db problem with a rather elegant decorator; but it's
still nowhere near how I'd like it to be.

On Sun, Feb 10, 2013 at 12:42 AM, Alec Taylor  wrote:
> 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 let's assume you don't want to).
>> When you define tables on an empty database, some .table files are created
>> in the databases/ folder .
>> They are pickles of the table structure, the same one DAL uses to compare
>> with the existing model and - optionally - do a migration.
>> Once you have those .table files, you can skip the define_table() statements
>> giving auto_import=True to the DAL connection (obviously the database uri
>> has to be the same one with the tables in it). The only thing you may need
>> is to pass along the folder where the .table files are with the folder
>> parameter .
>>
>> PS: an oauth2 implementation has been achieved by michele, it's a few days
>> away to be included in the web2py source .
>> https://github.com/web2py/web2py/pull/57
>
> Wait, what, seriously?!
>
> :(
>
> I can't see that pull request ATM (github is under maintenance), but I
> did post an announcement here on the web2py list over 8 days ago…
>
> Might've been nicer to tell me then.
>
> Anyway, I have around 30 custom exceptions built on the
> gluon.http.HTTP class, so will review the patch once github is back
> online and see what I can integrate… I guess

-- 

--- 
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/groups/opt_out.