Bugs item #1374419, was opened at 2005-12-06 04:35
Message generated for change (Comment added) made by nobody
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1374419&group_id=74338
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Postgres
Group: SQLObject from repository
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: ProgrammingError in _queryInsertID
Initial Comment:
Hi,
i'm using SQLObject packaged with TurboGears on an
existing PostgreSQL DB with the primary_key beeing a
string.
My model.py:
--------------------------
[...]
class Authreg(SQLObject):
class sqlmeta:
idType= StringType
idName = "username"
username = StringCol(alternateID = True)
[...]
--------------------------
Versions:
The latest SQLObject from repository ('cause of the
idType opportunity), python 2.4.2, PostgreSQL 7.4.9.
Accessing the existing entrys works fine, changing
those, too. Creating a new entry results in the
following traceback. It seems, that SQLObject tries to
receive a sequence from the DB although the primary_key
is a StringType.
Traceback:
--------------------------
Traceback (most recent call last):
File
"/usr/lib/python2.4/site-packages/CherryPy-2.1.0-py2.4.egg/cherrypy/_cphttptools.py",
line 271, in run
main()
File
"/usr/lib/python2.4/site-packages/CherryPy-2.1.0-py2.4.egg/cherrypy/_cphttptools.py",
line 502, in main
body = page_handler(*args, **cherrypy.request.paramMap)
File
"/usr/lib/python2.4/site-packages/TurboGears-0.8a4-py2.4.egg/turbogears/controllers.py",
line 121, in newfunc
output = func(self, *args, **kw)
File "/home/project/foo/bla/bla/controllers.py", line
86, in change
hash=new_hash)
File
"/usr/lib/python2.4/site-packages/SQLObject-0.8dev_r1346-py2.4.egg/sqlobject/main.py",
line 1248, in __init__
self._create(id, **kw)
File
"/usr/lib/python2.4/site-packages/SQLObject-0.8dev_r1346-py2.4.egg/sqlobject/main.py",
line 1277, in _create
self._SO_finishCreate(id)
File
"/usr/lib/python2.4/site-packages/SQLObject-0.8dev_r1346-py2.4.egg/sqlobject/main.py",
line 1301, in _SO_finishCreate
id, names, values)
File
"/usr/lib/python2.4/site-packages/SQLObject-0.8dev_r1346-py2.4.egg/sqlobject/dbconnection.py",
line 802, in queryInsertID
return self._dbConnection._queryInsertID(
File
"/usr/lib/python2.4/site-packages/SQLObject-0.8dev_r1346-py2.4.egg/sqlobject/postgres/pgconnection.py",
line 122, in _queryInsertID
c.execute("SELECT NEXTVAL('%s')" % sequenceName)
ProgrammingError: ERROR: relation
"authreg_username_seq" does not exist
SELECT NEXTVAL('authreg_username_seq')
--------------------------
Ruben Lang
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody)
Date: 2005-12-07 03:42
Message:
Logged In: NO
Hi,
i think i know my fault. I'm using non-integer keys, and i'm
not passing the id keyword to the constructor, instead i
passed username (since this is my column used as key). Now i
got to redesign a few things.
Sorry for bothering you,
Ruben Lang
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1374419&group_id=74338
|