It looks like you don't have the correct database wrapper for python
installed.  Try installing psycopg (you can get it here:
http://initd.org/pub/software/psycopg/)

I think that's your problem, but if that doesn't work, try using the
_test = True in the SQL statement to make sure you're getting what you
expect.  For instance:

class add:
    def POST(self):
        i = web.input()
        web.debug(web.insert('todo', title=i.title, _test=True))
        n = web.insert('todo', title=i.title)
        web.seeother('/')

Good luck,
Justin

On May 26, 6:51 pm, Charles Stuart <[EMAIL PROTECTED]> wrote:
> I'm getting an error while trying to follow the tutorial. The db is
> seemingly set up correctly as I manually added some rows via the psql
> command.
>
> I'm to the last step:
>
> class add:
>     def POST(self):
>         i = web.input()
>         n = web.insert('todo', title=i.title)
>         web.seeother('/')
>
> My code:http://pastie.caboo.se/203665
>
> The error:
> 127.0.0.1:52395 - - [26/May/2008 14:58:07] "HTTP/1.1 POST /add" - 200
> OK
> 127.0.0.1:52515 - - [26/May/2008 15:42:07] "HTTP/1.1 GET /" - 200 OK
> Traceback (most recent call last):
>   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> python2.5/site-packages/web/webapi.py", line 312, in wsgifunc
>     result = func()
>   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> python2.5/site-packages/web/request.py", line 129, in <lambda>
>     func = lambda: handle(getattr(mod, name), mod)
>   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> python2.5/site-packages/web/request.py", line 61, in handle
>     return tocall(*([x and urllib.unquote(x) for x in args] + fna))
>   File "/Users/cs/Sites/web.py/webpy.py", line 19, in POST
>   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> python2.5/site-packages/web/db.py", line 643, in insert
>     web.ctx.db_execute(db_cursor, sql_query)
>   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> python2.5/site-packages/web/db.py", line 356, in db_execute
>     out = cur.execute(sql_query.s, sql_query.v)
>   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> python2.5/site-packages/DBUtils-0.9.3-py2.5.egg/DBUtils/SteadyDB.py",
> line 335, in tough_method
>     result = method(*args, **kwargs) # try to execute
> ProgrammingError: argument formats can't be mixed
>
> 127.0.0.1:52515 - - [26/May/2008 15:42:09] "HTTP/1.1 POST /add" - 200
> OK
>
> Thanks,
> Charles
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to