Hi,
following the "IdentityManagement" tutorial, i found an error when i
try to insert a new user using Catwalk.
When I press "Save", the page doesn't proceed, and looking at the debug
window, i see:
10/Apr/2006:21:10:29 HTTP INFO Page handler: <bound method CatWalk.add
of <turbogears.toolbox.catwalk.CatWalk object at 0x01459590>>
Traceback (most recent call last):
File
"c:\python24\lib\site-packages\cherrypy-2.2.0-py2.4.egg\cherrypy\_cphttptools.py",
line 106, in _run
self.main()
File
"c:\python24\lib\site-packages\cherrypy-2.2.0-py2.4.egg\cherrypy\_cphttptools.py",
line 255, in main
body = page_handler(*virtual_path, **self.params)
File "<string>", line 3, in add
File "c:\documents and
settings\renzo\documenti\sw\python\turbogears\svn\turbogears\controllers.py",
line 206, in expose
output = database.run_with_transaction(expose._expose,func, accept,
allow_json, allow_json_from_config,*args, **kw)
File "c:\documents and
settings\renzo\documenti\sw\python\turbogears\svn\turbogears\database.py",
line 216, in run_with_transaction
retval = func(*args, **kw)
File "<string>", line 5, in _expose
File "c:\documents and
settings\renzo\documenti\sw\python\turbogears\svn\turbogears\controllers.py",
line 227, in <lambda>
expose._expose.when(rule)(lambda _func, accept, allow_json,
allow_json_from_config,*args,**kw: _execute_func( File "c:\documents
and
settings\renzo\documenti\sw\python\turbogears\svn\turbogears\controllers.py",
line 248, in _execute_func
output = errorhandling.try_call(func, *args, **kw)
File "c:\documents and
settings\renzo\documenti\sw\python\turbogears\svn\turbogears\errorhandling.py",
line 71, in try_call
output = func(self, *args, **kw)
File "c:\documents and
settings\renzo\documenti\sw\python\turbogears\svn\turbogears\toolbox\catwalk\__init__.py",
line 786, in add
new_object = obj(**params)
File
"c:\python24\lib\site-packages\sqlobject-0.7.1dev_r1684-py2.4.egg\sqlobject\declarative.py",
line 92, in _wrapper
return_value = fn(self, *args, **kwargs)
File
"c:\python24\lib\site-packages\sqlobject-0.7.1dev_r1684-py2.4.egg\sqlobject\main.py",
line 1197, in __init__
self._create(id, **kw)
File
"c:\python24\lib\site-packages\sqlobject-0.7.1dev_r1684-py2.4.egg\sqlobject\inheritance\__init__.py",
line 218, in _create
super(InheritableSQLObject, self)._create(id, **kw)
File
"c:\python24\lib\site-packages\sqlobject-0.7.1dev_r1684-py2.4.egg\sqlobject\main.py",
line 1216, in _create
raise TypeError, "%s() did not get expected keyword argument %s" %
(self.__class__.__name__, column.name)
TypeError: TG_User() did not get expected keyword argument user_name
Request Headers:
COOKIE: tg-visit=5ea0f88808457095144a1341f87c76df1eae0a38
Content-Length: 125
ACCEPT-CHARSET: ISO-8859-1,utf-8;q=0.7,*;q=0.7
USER-AGENT: Mozilla/5.0 (Windows; U; Windows NT 5.1; it; rv:1.8.0.1)
Gecko/20060111 Firefox/1.5.0.1
CONNECTION: keep-alive
PRAGMA: no-cache
CONTENT-LENGTH: 125
HOST: localhost:7654
CACHE-CONTROL: no-cache
CONTENT-TYPE: application/x-www-form-urlencoded
ACCEPT:
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Remote-Addr: 127.0.0.1
ACCEPT-LANGUAGE: it-it,it;q=0.8,en;q=0.5,en-us;q=0.3
Content-Type: application/x-www-form-urlencoded
Remote-Host: 127.0.0.1
ACCEPT-ENCODING: gzip,deflate
KEEP-ALIVE: 300
127.0.0.1 - - [10/Apr/2006:21:10:29] "POST /catwalk/add HTTP/1.1" 500
3264 "" "Mozilla/5.0 (Windows; U; Windows NT 5.1; it; rv:1.8.0.1)
Gecko/20060111 Firefox/1
.5.0.1"
In addiction, if i try to add a new user using "tg-admin shell", the
error is:
>>> from turbogears.identity.soprovider import *
>>> hub.begin()
<sqlobject.dbconnection.Transaction object at 0x00DAC970>
>>> u=TG_User(user_name="jeff", email_address="[EMAIL PROTECTED]",
... display_name="Jeff Watkins", password="xxxxx")
Traceback (most recent call last):
File "<console>", line 2, in ?
File
"c:\python24\lib\site-packages\sqlobject-0.7.1dev_r1684-py2.4.egg\sqlobject\declarative.py",
line 92, in _wrapper
return_value = fn(self, *args, **kwargs)
File
"c:\python24\lib\site-packages\sqlobject-0.7.1dev_r1684-py2.4.egg\sqlobject\main.py",
line 1197, in __init__
self._create(id, **kw)
File
"c:\python24\lib\site-packages\sqlobject-0.7.1dev_r1684-py2.4.egg\sqlobject\inheritance\__init__.py",
line 218, in _create
super(InheritableSQLObject, self)._create(id, **kw)
File
"c:\python24\lib\site-packages\sqlobject-0.7.1dev_r1684-py2.4.egg\sqlobject\main.py",
line 1221, in _create
self.set(**kw)
File
"c:\python24\lib\site-packages\sqlobject-0.7.1dev_r1684-py2.4.egg\sqlobject\main.py",
line 1097, in set
setattr(self, name, value)
File "c:\documents and
settings\renzo\documenti\sw\python\turbogears\svn\turbogears\identity\soprovider.py",
line 316, in _set_password
hash =
identity.current_provider.encrypt_password(cleartext_password)
File "c:\documents and
settings\renzo\documenti\sw\python\turbogears\svn\turbogears\identity\__init__.py",
line 79, in __getattr__
raise RequestRequiredException()
RequestRequiredException: An attempt was made to use a facility of the
TurboGears Identity Management framework that relies on an HTTP request
outside of a request.
Could you help me?
Have you any idea?
I'm using a SQLite DB.
Thanks,
Renzo
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears Trunk" 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/turbogears-trunk
-~----------~----~----~----~------~----~------~--~---