On Tuesday 18 December 2007 22:02:34 Sumant Turlapati wrote:
> Hi,
> I need some help configuring my TG application.
> I am wondering how do I specify a callback function for the
> session_filter.on_create_session or on_delete_session or
> on_renew_session properties in the app.cfg file in TG.
>
> I looked at CherryPy documentation, ConfigObj documentation and tried
> different things for e.g.
> the CherryPy documentation says i can provide a callback function but
> does not mention how to specify it.
>
> when a session expires i want TG to call one of my functions. say, if
> my function is called onDeleteSession and is located in
> myapp.submodels.sessionadmin.py then
>
> 1. in the config file i tried
> session_filter.on_delete_session =
> "myapp.submodels.sessionadmin.onDeleteSession"
> of course, when the session expired it tried to make this call but got
> an error saying str objects are not callable.
>
> 2. next i tried specifying it as is
> session_filter.on_delete_session =
> myapp.submodels.sessionadmin.onDeleteSession
> when i restart the TG server then it complains that this is not a
> valid name or type. specifically-
> " configobj.UnreprError: Unknown name or type in value at line 50."
>
> thanks a lot for your time and help

I don't know much about ConfigObj, but one thing I know: usually, using

<myprojectpackage>.somename 

seems to work. So maybe you can try and import the onDeleteSession-function 
into the namespace of myapp?

Diez


--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to