I am adding identity to an existing 0.9a2 project and am needing user
related fields that the default identity model does not supply.

So I mofified my Employee object to look like:

=========================================
class Employee(TG_User):
    _connection = hub

    lastName       = StringCol(length=25)
    firstName      = StringCol(length=15)
    mi             = StringCol(length=1)
    homePhone      = StringCol(length=12, default=None)
    cellPhone      = StringCol(length=12, default=None)
    status         = EnumCol(enumValues=['a','i'])
    timesheets     = MultipleJoin('Timesheet')
=========================================

I've modified my forms and grids and things were working well.

Except that on an "edit" operation, I retrieve the record and jsonify
it:

form_values = jsonify(Employee.get(id))

and pass the result on to the edit form.

This was working when I was just subclassing SQLObject.  But now I get
the output below:

====================================
Page handler: <bound method Root.employee_add_edit of
<tgta9a2.controllers.Root object at 0xb750056c>>
Traceback (most recent call last):
  File
"/usr/lib/python2.4/site-packages/CherryPy-2.2.0rc1-py2.4.egg/cherrypy/_cphttptools.py",
line 99, in _run
    self.main()
  File
"/usr/lib/python2.4/site-packages/CherryPy-2.2.0rc1-py2.4.egg/cherrypy/_cphttptools.py",
line 248, in main
    body = page_handler(*virtual_path, **self.params)
  File "<string>", line 3, in employee_add_edit
  File
"/usr/lib/python2.4/site-packages/TurboGears-0.9a2-py2.4.egg/turbogears/controllers.py",
line 207, in expose
    output = database.run_with_transaction(expose._expose,func, accept,
allow_json, allow_json_from_config,*args, **kw)
  File
"/usr/lib/python2.4/site-packages/TurboGears-0.9a2-py2.4.egg/turbogears/database.py",
line 216, in run_with_transaction
    retval = func(*args, **kw)
  File "<string>", line 5, in _expose
  File
"/usr/lib/python2.4/site-packages/TurboGears-0.9a2-py2.4.egg/turbogears/controllers.py",
line 228, in <lambda>
    expose._expose.when(rule)(lambda _func, accept, allow_json,
allow_json_from_config,*args,**kw: _execute_func(
  File
"/usr/lib/python2.4/site-packages/TurboGears-0.9a2-py2.4.egg/turbogears/controllers.py",
line 246, in _execute_func
    output = errorhandling.try_call(func, *args, **kw)
  File
"/usr/lib/python2.4/site-packages/TurboGears-0.9a2-py2.4.egg/turbogears/errorhandling.py",
line 59, in try_call
    output = func(self, *args, **kw)
  File "<string>", line 3, in employee_add_edit
  File
"/usr/lib/python2.4/site-packages/TurboGears-0.9a2-py2.4.egg/turbogears/identity/conditions.py",
line 233, in require
    return fn(self, *args, **kwargs)
  File "/home/steve/python/tgta9a2/tgta9a2/controllers.py", line 370,
in employee_add_edit
    form_values = jsonify(Employee.get(id))
  File "<string>", line 5, in jsonify
  File
"/usr/lib/python2.4/site-packages/TurboGears-0.9a2-py2.4.egg/turbogears/identity/soprovider.py",
line 316, in jsonify_user
    del result['password']
KeyError: 'password'
=========================================


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to