[web2py:19252] Re: web2py legacy databases, 'id' field requirement

2009-04-06 Thread David Niergarth
On Apr 1, 9:20 pm, Yarko Tymciurak wrote: > > http://www.postgresql.org/docs/8.3/interactive/sql-createrule.html > > and looking at this, it seems fairly straight forward: Yes it does. The manual threw me when it said that "*Currently* views are read only" but that "you can get the *effect* of a

[web2py:18951] Re: web2py legacy databases, 'id' field requirement

2009-04-01 Thread David Niergarth
usual DB API cursor methods (execute, fetchone, fetchall, etc.). That's all the flexibility I've ever had plus the SQLDB() handles the connection pooling for me. --David On Apr 1, 5:36 pm, Yarko Tymciurak wrote: > On Wed, Apr 1, 2009 at 3:22 PM, David Niergarth wrote: > > > But

[web2py:18939] Re: web2py legacy databases, 'id' field requirement

2009-04-01 Thread David Niergarth
But how would you handle updates (views being read-only). --David On Apr 1, 2:34 pm, Yarko Tymciurak wrote: > On Wed, Apr 1, 2009 at 12:34 AM, mdipierro wrote: > > > Can you create a custom database view and map the field? > > Yes - this is the way to do it in your db server.  You also want to

[web2py:18937] Re: psycopg2 connection type

2009-04-01 Thread David Niergarth
fferently than the other database backends. > > On Apr 1, 7:22 am, David Niergarth wrote: > > > > Is it really backward compatible? Have you tried? > > > I tried basic integer indexing and slicing, which work as expected, as > > does the dictionary interface. I jus

[web2py:18927] Re: Non-DAL usage question

2009-04-01 Thread David Niergarth
> something smarter if there is) > so all schema tables would be gathered in one schema with many views... just > an idea? > > Boris > > > > On Wed, Apr 1, 2009 at 6:24 AM, David Niergarth wrote: > > > I wondered if that might be the case. db._cursor will do jus

[web2py:18909] Re: psycopg2 connection type

2009-04-01 Thread David Niergarth
> Is it really backward compatible? Have you tried? I tried basic integer indexing and slicing, which work as expected, as does the dictionary interface. I just went through all the scenarios I could think of and found two differences with DictCursor. 1) Extended slicing fails with an except

[web2py:18898] psycopg2 connection type

2009-03-31 Thread David Niergarth
One postgres-specific change we made to our copy of gluon.sql to make things a bit easier was to add the import import psycopg2.extras and change the line self._pool_connection(lambda : psycopg2.connect(msg)) to self._pool_connection(lambda : psycopg2.extras.DictConn

[web2py:18896] Re: Non-DAL usage question

2009-03-31 Thread David Niergarth
om names where id=%(id)s;", > {'id': id}) > db._cursor.fetchall() > > On Mar 31, 10:54 pm, David Niergarth wrote: > > > For our application we are not using the ORM features of the DAL (see > > P.S. explanation). All of our non-auth queries use db.execute

[web2py:18890] Non-DAL usage question

2009-03-31 Thread David Niergarth
For our application we are not using the ORM features of the DAL (see P.S. explanation). All of our non-auth queries use db.executesql(sql). It seems like executesql() should support the optional mapping-or- tuple argument that the underlying DB API 2.0 cursor supports. For example, cursor.ex

[web2py:18887] Greetings and non-DAL usage question

2009-03-31 Thread David Niergarth
Hello, I was at the PyCon dojo and got to meet several of you afterward. The dojo project is a very good example for showing the breadth of web2py. I heard a couple of people say "How come nobody knows about web2py yet?" afterward. You may want to consider putting the dojo example on the web2py d

[web2py:18888] Greeting and non-DAL usage question

2009-03-31 Thread David Niergarth
Hello, I was at the PyCon dojo and got to meet several of you afterward. The dojo project is a very good example for showing the breadth of web2py. I heard a couple of people say "How come nobody knows about web2py yet?" afterward. You may want to consider putting the dojo example on the web2py d